Mathis Hofer wrote: > 2. I had to override the HTTPContent.write() method and put out the > strings without converting them to "str". Otherwise WebKit tried to > convert the CP1252-encoded string into ASCII which also resulted in a > UnicodeDecodeError for special chars. > > The latter is a general problem for web pages in Unicode and I think it > should be changed (if not already done): > The HTTPContent.write() should not convert the output to ASCII, since > this makes output in different encodings impossible... it should either > leave the output like it is so it's up to the developer to perform the > encoding, or it should use a customizable encoding.
Actually HTTPContent.write() does not convert its arguments to ASCII, but only to str; it's perfectly ok if they are CP1252-encoded strings. The problem comes when you pass unicode arguments. HTTPContent *must* convert them to str, because otherwise they cannot be appended to the output buffer. So the only thing HTTPContent could do is encode them according to some default encoding, probably utf-8. In your case utf-8 would have been the wrong guess and you might have been even more confused. But we could make the default encoding configurable. -- Chris ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Webware-devel mailing list Webware-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-devel