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

Matt Mackall mpm at selenic.com
Sun Nov 19 13:36:57 CST 2006


On Sun, Nov 19, 2006 at 03:44:19PM +0100, Thomas Arendsen Hein wrote:
> * Andrey <grooz-work at gorodok.net> [20061119 12:34]:
> > On 19 November 2006 (Sun) 03:15, Marcos Chaves wrote:
> > > 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.
> 
> Problems like this are exactly why I think having a config setting
> is important. According to the bzr code Andrey cited there were
> problems on darwin, too.
> 
> Matt?

I think I'm convinced.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list