Some questions about decode/encode

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sun Jan 27 05:39:17 EST 2008


On Sun, 27 Jan 2008 02:18:48 -0800, glacier wrote:

> Yepp. I feed SAX with the unicode string since SAX didn't support my
> encoding system(GBK).

If the `decode()` method supports it, IMHO SAX should too.

> Is there any way to solve this better?
> I mean if I shouldn't convert the GBK string to unicode string, what
> should I do to make SAX work?

Decode it and then encode it to utf-8 before feeding it to the parser.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list