Python - Way to encode foreign characters in format Python can work with?
Question: I'm working with large files in French and German. Basically, writing strings
of characters from one file to another, collecting data from them, and so
forth. Unfortunately, I have no idea what to import in order to let Python
handle these characters.

Even when collecting data from files that Python has already converted (in
french you get weird things like Ã©couteur Ã§a), I get key errors when
checking dicts for things that I _know_ have already been placed in that dict,
but only when the items have special characters in them like in the example of
Ã©couteur Ã§a.

For example, when the tuple ('Ã©couteur', 'Ã§a') has been added to a dict
which collects the frequency that any given pair of words occur together, you
get a key error when probing that dict for the tuple ('Ã©couteur', 'Ã§a'), but
not when probing the dict for other tuples that don't contain the wacky
characters.

Does anyone know a quick way to get around this issue at every level?

Best, Georgina


Answer: ["Unicode in Python, Completely
Demystified"](http://farmdev.com/talks/unicode/)

