Convertion of Unicode to ASCII NIGHTMARE

Diez B. Roggisch deets at nospam.web.de
Mon Apr 3 12:34:25 EDT 2006


> Don't. You can't. Those characters don't exist in the ASCII character set.
> SQLite 3.0 deals with UTF-8 encoded SQL statements, though.

That is not entirely correct - one can, if losing information is ok. The OPs
code that normalized UTF-8 to NFKD, an umlaut like ä is transformed to a
two-character-sequence basically saying "a with two dots on top". With
'ignore' specified as parameter to the encoder, this should be result in
the letter a.


Regards,

Diez



More information about the Python-list mailing list