Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Ragnar Ouchterlony
tis 2007-05-29 klockan 16:08 -0300 skrev Gabriel Genellina: > sys.stdout = filewrapper(sys.stdout, 'utf-8') > print u"åäö \N{GREEK CAPITAL LETTER DELTA}" > > > > Useful if you don't want to append .encode() to everything you print out > > that potentially can contain non-ascii letters. >

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Gabriel Genellina
En Tue, 29 May 2007 15:16:52 -0300, Ragnar Ouchterlony <[EMAIL PROTECTED]> escribió: > If I for some reason can't open the object myself or needs encoding on > other file-like objects, I think the following wrapper function is of > use (it essentially does what codecs.open() does but takes a fil

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Ragnar Ouchterlony
tis 2007-05-29 klockan 09:05 +0200 skrev "Martin v. Lo"wis": > Yes, when writing to a file, you need to define an encoding, e.g. > > self.file.write(data.encode("utf-8")) > > You can use codecs.open() instead of open(), > so that you can just use self.file.write(data) If I for some reason can't

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Gabriel Genellina
En Tue, 29 May 2007 04:24:15 -0300, 人言落日是天涯,望极天涯不见家 <[EMAIL PROTECTED]> escribió: > On 5月29日, 下午3时05分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: >> > yes, it could print to the terminal(cmd.exe), but when I write these >> > string to file. I got the follow error: >> >> > File "E:\Tools\fi

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread 人言落日是天涯,望极天涯不见家
On 5月29日, 下午3时05分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > > yes, it could print to the terminal(cmd.exe), but when I write these > > string to file. I got the follow error: > > > File "E:\Tools\filegen\filegen.py", line 212, in write > > self.file.write(data) > > UnicodeEncodeError:

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-29 Thread Martin v. Lo
> yes, it could print to the terminal(cmd.exe), but when I write these > string to file. I got the follow error: > > File "E:\Tools\filegen\filegen.py", line 212, in write > self.file.write(data) > UnicodeEncodeError: 'ascii' codec can't encode character u'\u0394' in > position 0 > : ordinal

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-28 Thread 人言落日是天涯,望极天涯不见家
On 5月29日, 下午1时34分, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > 人言落日是天涯,望极天涯不见家 schrieb: > > > I lookup the utf-8 form of delta from the link. > >http://www.fileformat.info/info/unicode/char/0394/index.htm > > > and then I want to print it in the python ( I work under windows) > > > #!/usr/bin/p

Re: how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-28 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > I lookup the utf-8 form of delta from the link. > http://www.fileformat.info/info/unicode/char/0394/index.htm > > and then I want to print it in the python ( I work under windows) > > #!/usr/bin/python > #coding=utf-8 > > print "\xce\x94" > > but the result is not the

how to print the GREEK CAPITAL LETTER delta under utf-8 encoding

2007-05-28 Thread 人言落日是天涯,望极天涯不见家
I lookup the utf-8 form of delta from the link. http://www.fileformat.info/info/unicode/char/0394/index.htm and then I want to print it in the python ( I work under windows) #!/usr/bin/python #coding=utf-8 print "\xce\x94" but the result is not the 'delta' but an unknown character. -- http://