Locale and cookies

2005-05-02 Thread dagurp
I'm doing a small mod_python project and I'm using a locale for my own
language. This is not a problem until I start using cookies because the
cookie module in mod_python uses time.strftime() to write the
expiration times and therefore makes invalid cookies.
I tried to fix this by changing the locale back to "English" before
creating cookies and that works on Windows but not for Linux. If I use
"en_EN.ISO8859-1" it works on Linux but not on Windows.

I'm sure there's an easy way to fix this.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Locale and cookies

2005-05-03 Thread dagurp
Setting it to "C" worked fine. Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list


xml.parsers.expat and utf-8

2005-05-03 Thread dagurp
I have this code:

import xml.parsers.expat
parser = xml.parsers.expat.ParserCreate(encoding="UTF-8")
text = unicode("þórður",'UTF-8')
print parser.Parse(text,1)

And this is what I get:
UnicodeEncodeError: 'ascii' codec can't encode characters in position
5-6: ordinal not in range(128)


I think I've tried all variations possible but I always get errors.
Anyone know what I'm doing wrong?

-- 
http://mail.python.org/mailman/listinfo/python-list