[PATCH 2 of 6] Determine default locale encoding and stdio encoding on start-up

Andrey grooz-work at gorodok.net
Sun Nov 19 05:33:03 CST 2006


On 19 November 2006 (Sun) 03:15, Marcos Chaves wrote:
> Hi Andrey,
>
> if this information helps, bzr crashes on my windows the way it
>
> handles the encodings. For some reason, if I run:
> > chcp
>
> Active code page: 0
>
> Then bzr tries to set codepage 'cp0' and crashes. Not sure why, since
> locale.getpreferredencoding() gives me "cp1252", and
> locale.getdefaultlocale() gives me "('pt_BR', 'cp1252')". Anyway, I
> don't know how this works...

Looks like 'cp0' is what sys.stdout.encoding gives on your system. I am no 
windows expert at all, but IIRC Windows has as setting called "code page for 
non-Unicode programs" somewhere in Control Panel->Language Settings, and you 
just have to find it and choose the preferred code page.

Andrey


More information about the Mercurial-devel mailing list