[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal raises an error (Py3)

Ezio Melotti report at bugs.python.org
Tue Feb 3 15:01:50 CET 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

> Problem: use different (encoding) rule for the display hook and for
> print() may disturb new users (Why does ">>> chr(...)" work whereas
> ">>> print(chr(...))" fails?).

This is the same behavior that Python2.x has (with the only difference
that Py2 always show the char as u'\uXXXX' if >0x7F whereas Py3 /tries/
to display it):
>>> unichr(0x0100)
u'\u0100'
>>> print unichr(0x0100)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u0100' in
position 0: character maps to <undefined>

----------
title: Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3) -> Printing Unicode chars from the interpreter in a non-UTF8 terminal raises an error (Py3)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5110>
_______________________________________


More information about the Python-bugs-list mailing list