First bazaar-ng experience

Uros Trebec uros.trebec at gmail.com
Wed Jun 29 18:36:42 BST 2005


On 6/29/05, John A Meinel <john at arbash-meinel.com> wrote:
> Just for the sake of argument, try the following, in the file:
> $bzrroot/bzrlib/__init__.py
> There is the following lines:
> import locale
> user_encoding = locale.getpreferredencoding()
> del locale
> 
> Just add these lines right after it:
> if user_encoding is None:
>     user_encoding='UTF-8' 

Hey, this actually works! :) Thanks.


> I think that will at least stop it from failing on you.
> Now the trick is to figure out what the default encoding should be if
> getpreferredencoding() should fail.
> On my linux box, it seems to be "UTF-8", under cygwin it is "US_ASCII",
> on windows it seems to be 'cp1252'.
> On *my* mac it seems to be 'mac-roman'.

I don't really know python so I can't help with that, sorry. I can
only tell you that my Terminal.app on Mac has utf-8 as default
encoding, which seams to work with other apps. On the other hand, the
LOCAL and LC* variables are not set. And even if I set them bzr still
fails.

> 
> Now, we could default it based on sys.platform, but really the point is
> that the system should be setting a preferred encoding.
> I'm not sure why your mac is not.
> 
> I would actually argue that the best fallback encoding is utf-8, since
> it means you should be able to encode any international characters.

I agree, this should be changed in official bzr release.


Uros




More information about the bazaar mailing list