Faulty encoding settings

Neil Cerutti horpner at yahoo.com
Tue Oct 17 14:23:19 EDT 2006


On 2006-10-17, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> In <slrnej9ogv.nk.horpner at FIAD06.norwich.edu>, Neil Cerutti wrote:
>> I'm writing an application that needs all internal character data
>> to be stored in iso-8859-1. It also must allow input and output
>> using stdin and stdout.
>
> Give the user the ability to explicitly give an encoding.
> Using the encoding attribute of files is quite fragile.  If you
> redirect stdin or stdout the encoding is set to None for
> example because the interpreter can't tell what encoding the
> "other side" of the redirection produces or expects.

Thanks for that sensible idea.

On the other hand, if Python's implementors couldn't figure out
what the encoding is, I doubt the average user has a prayer. ;-)

-- 
Neil Cerutti



More information about the Python-list mailing list