Re: UTF-8 in basic CGI mode

2008-01-17 Thread coldpizza
Thanks, Sion, that makes sense! Would it be correct to assume that the encoding of strings retrieved by FieldStorage() would be the same as the encoding of the submitted web form (in my case utf-8)? Funny but I have the same form implemented in PSP (Python Server Pages), running under Apache with

Re: UTF-8 in basic CGI mode

2008-01-16 Thread Sion Arrowsmith
coldpizza <[EMAIL PROTECTED]> wrote: >I am using this 'word' variable like this: > >print u'' % (word) > >and apparently this causes exceptions with non-ASCII strings. > >I've also tried this: >print u'' % >(word.encode('utf8')) >but I still get the same UnicodeDecodeError.. Your 'word' i

UTF-8 in basic CGI mode

2008-01-15 Thread coldpizza
Hi, I have a basic Python CGI web form that shows data from a SQLite3 database. It runs under the built-in CGIWebserver which looks something like this: [code] from BaseHTTPServer import HTTPServer from CGIHTTPServer import CGIHTTPRequestHandler HTTPServer("8000", CGIHTTPRequestHandler).serve_fo

UTF-8 in basic CGI mode

2008-01-15 Thread coldpizza
Hi, I have a basic Python CGI web form that shows data from a SQLite3 database. It runs under the built-in CGIWebserver which looks like this: [code] import SimpleHTTPServer import SocketServer SocketServer.TCPServer(("", 80),SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever() [/code] The