How to use 8bit character sets?

John Roth newsgroups at jhrothjr.com
Mon Jun 13 18:48:37 EDT 2005


""Martin v. Löwis"" <martin at v.loewis.de> wrote in message 
news:42ADEFEA.80007 at v.loewis.de...
> John Roth wrote:
>>> That is the default.
>>
>>
>> As far as I can tell, there are actually two defaults, which tends
>> to confuse things.
>
> Notice that there are two defaults already in the operating system:
> Windows has the notion of the "ANSI code page" and the "OEM code
> page", which are used in different contexts.
>
>> 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.)
>
> You mean, in Python? No, this is not how it works. On output
> of 8-bit strings to stdout, no conversion is ever performed:
> the byte strings are written to stdout as-is.

That's true, but I was talking about outputing unicode strings,
not 8-bit strings. As  you say below, the OP may not have
been talking about that.

>> The other is used whenever the unicode to 8-bit conversion
>> doesn't have a context - that's usually Ascii-7.
>
> Again, you seem to be talking about Unicode conversions -
> it's not clear that the OP is actually interested in
> Unicode conversion in the first place.
>
> Regards,
> Martin

John Roth 




More information about the Python-list mailing list