Re: q: how to output a unicode string?

2007-04-25 Thread Richard Brodie
"Frank Stajano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I find the encode/decode terminology somewhat confusing, because arguably > both sides are > "encoded". For example, a unicode-encoded string (I mean a sequence of > unicode code > points) should count as "decoded"

Re: q: how to output a unicode string?

2007-04-25 Thread Frank Stajano
Diez B. Roggisch wrote: >> So why is it that in the first case I got UnicodeEncodeError: 'ascii' >> codec can't encode? Seems as if, within Idle, a utf-8 codec is being >> selected automagically... why should that be so there and not in the >> first case? > > I'm a bit confused on what you did whe

Re: q: how to output a unicode string?

2007-04-25 Thread Diez B. Roggisch
> So why is it that in the first case I got UnicodeEncodeError: 'ascii' > codec can't encode? Seems as if, within Idle, a utf-8 codec is being > selected automagically... why should that be so there and not in the > first case? I'm a bit confused on what you did when the error appears if you t

Re: q: how to output a unicode string?

2007-04-25 Thread Frank Stajano
Diez B. Roggisch wrote: > Frank Stajano wrote: > >> A simple unicode question. How do I print? >> >> Sample code: >> >> # -*- coding: utf-8 -*- >> s1 = u"héllô wórld" >> print s1 >> # Gives UnicodeEncodeError: 'ascii' codec can't encode character >> # u'\xe9' in position 1: ordinal not in range(12

q: how to output a unicode string?

2007-04-24 Thread Frank Stajano
A simple unicode question. How do I print? Sample code: # -*- coding: utf-8 -*- s1 = u"héllô wórld" print s1 # Gives UnicodeEncodeError: 'ascii' codec can't encode character # u'\xe9' in position 1: ordinal not in range(128) What I actually want to do is slightly more elaborate: read from a tex

Re: q: how to output a unicode string?

2007-04-24 Thread Diez B. Roggisch
Frank Stajano wrote: > A simple unicode question. How do I print? > > Sample code: > > # -*- coding: utf-8 -*- > s1 = u"héllô wórld" > print s1 > # Gives UnicodeEncodeError: 'ascii' codec can't encode character > # u'\xe9' in position 1: ordinal not in range(128) > > > What I actually want to