Re: a question about unicode in python

2007-06-13 Thread Evan Klitzke
On 6/13/07, Andre Engels <[EMAIL PROTECTED]> wrote: > 2007/6/12, WolfgangZ <[EMAIL PROTECTED]>: > > hzqij schrieb: > > > i have a python source code test.py > > > > > > # -*- coding: UTF-8 -*- > > > > > > # s is a unicode string, include chinese > > > s = u'张三' > > > > > > then i run > > > > > > $

Re: a question about unicode in python

2007-06-13 Thread Andre Engels
2007/6/12, WolfgangZ <[EMAIL PROTECTED]>: > hzqij schrieb: > > i have a python source code test.py > > > > # -*- coding: UTF-8 -*- > > > > # s is a unicode string, include chinese > > s = u'张三' > > > > then i run > > > > $ python test.py > > UnicodeDecodeError: 'utf8' codec can't decode bytes in po

Re: a question about unicode in python

2007-06-12 Thread kyosohma
On Jun 12, 12:29 pm, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 6/12/07, hzqij <[EMAIL PROTECTED]> wrote: > > > i have a python source code test.py > > > # -*- coding: UTF-8 -*- > > As Marc pointed out, you should test the actual file encoding of the > program to check that it is, in fact, UTF-

Re: a question about unicode in python

2007-06-12 Thread Evan Klitzke
On 6/12/07, hzqij <[EMAIL PROTECTED]> wrote: > i have a python source code test.py > > # -*- coding: UTF-8 -*- As Marc pointed out, you should test the actual file encoding of the program to check that it is, in fact, UTF-8 encoded. If you're on a Unix/Linux system you should be able to test for a

Re: a question about unicode in python

2007-06-12 Thread WolfgangZ
hzqij schrieb: > i have a python source code test.py > > # -*- coding: UTF-8 -*- > > # s is a unicode string, include chinese > s = u'张三' > > then i run > > $ python test.py > UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: > invalid data > > by in python interactive, it i

Re: a question about unicode in python

2007-06-12 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, hzqij wrote: > i have a python source code test.py > > # -*- coding: UTF-8 -*- > > # s is a unicode string, include chinese > s = u'张三' > > then i run > > $ python test.py > UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: > invalid data > > by in p