Internationalisation of bzr cli

Alexander Belchenko bialix at ukr.net
Fri Apr 29 09:44:04 UTC 2011


Philippe Lhoste пишет:
> On 29/04/2011 09:57, Alexander Belchenko wrote:
>> If you want to work on it then please consider adding proper support 
>> for Windows as it
>> done in QBzr and Bazaar Explorer (the basic idea available as small 
>> and separate project:
>> https://launchpad.net/gettext-py-windows)
> 
> Yes!
> One, perhaps obvious, issue is where text is displayed/redirected on 
> Windows.

Last sprint I've talked with Martin about adding global command-line 
option --encoding to force specific encoding of output. I don't remember 
the resume on this.

> Well, I fear there is no good/real solution for this. Unless, perhaps 
> changing the charset of the console to UTF-8, which isn't obvious to 
> everybody (I know I can do that, I don't even recall how it can be 
> done...).
> [... reaching the browser ...] That's chcp 65001
> But Bazaar doesn't understand it. :-(

*Python* does not understand it. Bazaar is Python application and it 
heavily relies on what Python as platform provides.

> I noticed that at least Bzr 2.3 handle Unicode better than in the past.

Very strange. Really.

D:\Temp\BzrTest
>  > chcp 65001
> Page de codes active : 65001
> 
> D:\Temp\BzrTest
>  > bzr log -v
> bzr: warning: unknown terminal encoding cp65001.

This error comes from Python. It has no knowledge about cp65001. Maybe 
bzr can add alias for this encoding to treat it as utf-8. Although in my 
experiments it's not possible to print anything correctly from python to 
console with such encoding. Again, Python as platform.

>   Using encoding cp1252 instead.


> When I redirect output to a file, it uses the terminal's CP, which is, 
> by default, different from the default Windows one... That's the part 
> which is probably hard to impossible to check (a program cannot know if 
> its output is redirected, right?).
> I suppose the solution is more at the user level, setting the code page 
> in the editor, or in the console or something. :-(
> 
> Just to say that I18N is a good idea, but can have gotchas on some 
> platforms, for command line applications...

Yep :-/



More information about the bazaar mailing list