Windows locale: default charset

Martin v. Löwis martin at v.loewis.de
Fri Nov 29 15:43:39 EST 2002


antonmuhin íà rambler.ru <antonmuhin at rambler.ru> writes:

> I want to find out default Windows charset to perform
> encoding/decoding of Unicode strings.
> 
> locale module seems of no help---nl_langinfo function that could
> provide me with needed info isn't included in ActiveState Python 2.2.
> I found no similar functions in win extensions modules either.
> 
> May anybody point me info or snippets?

On Windows, locale.getlocale()[1] works well (although it does not
work that well on other systems). In Python 2.3,
locale.getpreferredencoding will work uniformly on all systems.

Regards,
Martin




More information about the Python-list mailing list