I am new to unicode so please bear with my stupidity.
I am doing the following in a Python IDE called Wing with Python 23.
äöü
äöü
'\xc3\xa4\xc3\x b6\xc3\xbc'
u'\xe4\xf6\xfc'
u'\xe4\xf6\xfc'
äöü
äöü
Why can't I get äöü printed from utf-8 and I can from latin1? How
can I use utf-8 exclusivly and be able to print the characters?
I also did the same thing an the same machine in a command window...
ActivePython 2.3.2 Build 230 (ActiveState Corp.) based on
Python 2.3.2 (#49, Oct 24 2003, 13:37:57) [MSC v.1200 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
äöü
'\x84\x94\x81'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeDecodeEr ror: 'utf8' codec can't decode byte 0x84 in position 0:
unexpected code byte
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeDecodeEr ror: 'utf8' codec can't decode byte 0x84 in position 0:
unexpected code byte
Why such a difference from the IDE to the command window in what it can
do and the internal representation of the unicode?
Thanks,
Shel
I am doing the following in a Python IDE called Wing with Python 23.
>>s = "äöü"
>>print s
>>print s
>>print s
>>s
>>s.decode('u tf-8')
>>u = s.decode('utf-8')
>>u
>>u
>>print u.encode('utf-8')
>>print u.encode('latin 1')
Why can't I get äöü printed from utf-8 and I can from latin1? How
can I use utf-8 exclusivly and be able to print the characters?
I also did the same thing an the same machine in a command window...
ActivePython 2.3.2 Build 230 (ActiveState Corp.) based on
Python 2.3.2 (#49, Oct 24 2003, 13:37:57) [MSC v.1200 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>>s = "äöü"
>>print s
>>print s
>>s
>>s.decode('u tf-8')
File "<stdin>", line 1, in ?
UnicodeDecodeEr ror: 'utf8' codec can't decode byte 0x84 in position 0:
unexpected code byte
>>u = s.decode('utf-8')
File "<stdin>", line 1, in ?
UnicodeDecodeEr ror: 'utf8' codec can't decode byte 0x84 in position 0:
unexpected code byte
>>>
do and the internal representation of the unicode?
Thanks,
Shel
Comment