A documentação para este módulo pode ser editada em Módulo:Utf8ToAnsi/doc.
Este módulo converte caracteres acentuados (do português) na sua versão ANSI "escaped".
local export = {}
-- this function enables the module to be called from a template
function export.main(frame)
if type(export]) == 'function' then
return export](frame.args, frame.args)
else
return export]]
end
end
function export.convert_diacritics(word)
word = mw.ustring.gsub(word, "à", "a")
word = mw.ustring.gsub(word, "á", "a")
word = mw.ustring.gsub(word, "â", "a")
word = mw.ustring.gsub(word, "ã", "a")
word = mw.ustring.gsub(word, "ç", "c")
word = mw.ustring.gsub(word, "é", "e")
word = mw.ustring.gsub(word, "ê", "e")
word = mw.ustring.gsub(word, "í", "i")
word = mw.ustring.gsub(word, "ó", "o")
word = mw.ustring.gsub(word, "ô", "o")
word = mw.ustring.gsub(word, "ú", "u")
word = mw.ustring.gsub(word, "ü", "u")
return word
end
return export