Costas Malamas [mailto:[EMAIL PROTECTED] wrote: > > I've been researching a move of my website to Unicode instead of the > Latin-1/Ascii mess that it's now. I realized that WK/FFK may limit that > process; so my question is, is there a way (easy or hard) to have WK/FFK > treat both input and output as unicode? That includes both Page.write() > on the output side, and request processing within WK and FFK (GET and POST > variables). Is it as easy as using sys.setdefaultencoding() or are there > issues I am not seeing?
I don't think that anything involving Unicode is as easy as setting the default encoding (and crossing one's fingers), but then you only really need to worry about converting to Unicode when receiving input from the request, and then converting from Unicode when sending output to the response. This is assuming that you've decided to use Unicode everywhere internally, of course. It certainly can be very tricky to deal with input encodings, in my experience. The specifications say, for example, that for any data included in a URL (eg. GET data), you're supposed to regard it as Latin-1 encoded at the most exotic, but then some Web browsers can be configured to send such data using UTF-8 character codes. Meanwhile, I would suppose that for POST data, the "Content-Type" header would specify the actual encoding used, but Webware (using the CGI adapter with Apache) doesn't seem to pass on this information. It's so confusing that I can't remember what I've previously done, but I do seem to recall that I aimed to be consistent with the encoding I use when writing information out to the response. You could keep using "ISO-8859-1" as your output encoding, assume that the request data is using the same encoding, and probably not notice a big difference or inconvenience. I know that I'll probably have to take a closer look at my code to be sure that it will always do what I want in any encoding. Paul ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
