On Tue, Apr 20, 2010 at 9:52 PM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > Sebastian <ba...@redtoad.de> writes: >> All locales return error messages in English. Only the Japanese uses >> Japanese which my regular expressions cannot handle at the moment. > > What exactly are you expecting to happen, and what exactly happens > instead? > > General advice with character sets in Python apply: always explicitly > declare the encoding of input, then decode to Unicode interally as early > as possible, and process all text that way. Only fix into an encoding > when it's time to output.
I think he has more of a *literal* language problem: He doesn't know Japanese and thus can't read the Japanese error message in order to develop a regex for it. I assume there's some reason he can't just do a blind equality test on the error message string(s). Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list