Never been to DZone Snippets before?

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 (See related posts)

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) )

You need to create an account or log in to post comments to this site.


Click here to browse all 5143 code snippets

Related Posts