[New-bugs-announce] [issue5081] Unable to print Unicode characters in Python 3 on Windows

Giampaolo Rodola' report at bugs.python.org
Tue Jan 27 13:51:59 CET 2009

New submission from Giampaolo Rodola' <billiejoex at users.sourceforge.net>:

While trying to port pyftpdlib to Python 3.x I noticed that Python 3.0
has a serious issue since unable to print certain unicode characters on

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win
Type "help", "copyright", "credits" or "license" for more information.
>>> print('\u20ac')  # euro sign
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python30\lib\io.py", line 1491, in write
    b = encoder.encode(s)
  File "C:\python30\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u20ac' in
0: character maps to <undefined>

Note that the same thing works on Python 2.6

Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on
Type "help", "copyright", "credits" or "license" for more information.
>>> print unicode('\u20ac')

This same thing is also discussed on python ml:

components: None
messages: 80650
nosy: giampaolo.rodola
severity: normal
status: open
title: Unable to print Unicode characters in Python 3 on Windows
type: crash
versions: Python 3.0, Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list