[issue3648] 'ascii' shoud be range(256) or just set another default encoding

Antoine Pitrou report at bugs.python.org
Fri Aug 22 17:35:19 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

> Sometimes 
> encoding problems in Python are driving me mad.

The thing is, they are not "encoding problems in Python", they are
encoding problems in the outside world. Python cannot know magically
which encoding is used in third-party data, so you have to tell it
yourself what the encoding is.

The default is "ascii" because only ASCII chars (from 32 to 127) can be
interpreted properly in most situations without having any knowledge of
the encoding (barring obsolete stuff such as EBCDIC, that is).

The only solution is to know what encoding you are expecting and
decode/encode it yourself. Python can't decide it for you.

----------
nosy: +pitrou
resolution:  -> invalid
status: open -> closed

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


More information about the Python-bugs-list mailing list