Re: [Tutor] unicode type on cgi script

2005-03-15 Thread Lolo
Hi, Try this solution. Create a script named sitecustomize.py into your python lib directory (i.e /usr/lib/python2.3) and add the following code : #---sitecustomize.py--- import sys sys.setdefaultencoding('latin-1') See u, Lja --- BRINER Cedric <[EMAIL PROTECTED]> wrote: > python-2.3 apa

Re: [Tutor] unicode type on cgi script

2005-03-15 Thread Kent Johnson
BRINER Cedric wrote: print uses sys.stdout.encoding to encode unicode strings. You can check what this is in your cgi with import sys print sys.stdout.encoding didn't know I think it will work to explicitly encode the unicode string in the encoding you want for the web page. Try print content.enc

Re: [Tutor] unicode type on cgi script

2005-03-15 Thread Kent Johnson
BRINER Cedric wrote: python-2.3 apache2 hi, I'm trying to use unicode function into a cgi script with no success. # cedric.py--- #!/usr/bin/python import os,sys import cgi import cgitb; cgitb.enable() print "Content-Type: text/html\ "+os.linesep+"\ "+os.linesep+"hipo'potame" sys.stdout.flus

[Tutor] unicode type on cgi script

2005-03-15 Thread BRINER Cedric
python-2.3 apache2 hi, I'm trying to use unicode function into a cgi script with no success. # cedric.py--- #!/usr/bin/python import os,sys import cgi import cgitb; cgitb.enable() print "Content-Type: text/html\ "+os.linesep+"\ "+os.linesep+"hipo'potame" sys.stdout.flush() content = u'c\xe