theller at ctypes.org
Fri Mar 15 11:46:36 CET 2013
I thought I understand unicode (somewhat, at least), but this seems
not to be the case.
I expected the following code to print 'µm' two times to the console:
# -*- coding: cp850 -*-
a = u"µm"
b = u"\u03bcm"
But what I get is this:
Traceback (most recent call last):
File "x.py", line 7, in <module>
File "C:\Python33-64\lib\encodings\cp850.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u03bc' in
position 0: character maps to <undefined>
Using (german) windows, command prompt, codepage 850.
The same happens with Python 2.7. What am I doing wrong?
More information about the Python-list