DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Converting Some French Chars With Python
because translate and maketrans don't love utf-8 ;-(
import string
french=u"15 résultats trouvés".encode("utf_16")
sfrom = u"à âäéèêëïîôöûùüç".encode("utf_16")
sto = u"aaaeeeeiioouuuc".encode("utf_16")
print french.translate( string.maketrans(sfrom,sto) )




