sys.stdin.encoding

aine_canby at yahoo.com aine_canby at yahoo.com
Mon Dec 11 05:00:02 EST 2006


Duncan Booth skrev:

> aine_canby at yahoo.com wrote:
>
> > The call to sys.getdefaultencoding() returns ascii. Since I can enter
> > the characters åöä on the command line in Pydef/Eclipse doesn't that
> > mean that the stdin is not ascii? What should I do?
> >
> I think that depends on what sort of script you are writing.
>
> If it is just something for personal use on a single machine, or if you
> know that the same encoding is going to be used on all systems where you
> have this problem, then you could hardwire the encoding to whatever it
> should be (maybe 'latin1').
>
> If it is to be used across a variety of systems with different encodings
> then you'll have to figure out some way to find the correct encoding.

Yeah I'm only learning python so I think I can go with latin1.

Cheers,

Aine.




More information about the Python-list mailing list