How to use 8bit character sets?

John Roth newsgroups at jhrothjr.com
Mon Jun 13 07:30:35 EDT 2005


""Martin v. Löwis"" <martin at v.loewis.de> wrote in message 
news:42ad11a7$0$24953$9b622d9e at news.freenet.de...
> copx wrote:
>> For some reason Python (on Windows) doesn't use the system's default
>> character set and that's a serious problem for me.
>
> I very much doubt this statement: Python does "use" the system's default
> character set on Windows. What makes you think it doesn't?
>
>> Is it possible to tell Python to use an 8bit charset (latin-1 in my case)
>> for textfile and string processing by default?
>
> That is the default.

As far as I can tell, there are actually two defaults, which tends
to confuse things. One is used whenever a unicode to 8-bit
conversion is needed on output to stdout, stderr or similar;
that's usually Latin-1 (or whatever the installation has set up.)
The other is used whenever the unicode to 8-bit conversion
doesn't have a context - that's usually Ascii-7.

John Roth

>
> Regards,
> Martin 




More information about the Python-list mailing list