Internationalisation of bzr cli

Philippe Lhoste PhiLho at GMX.net
Fri Apr 29 09:32:11 UTC 2011


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.
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. :-(
I noticed that at least Bzr 2.3 handle Unicode better than in the past.

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:\Temp\BzrTest
 > bzr init
Created a standalone tree (format: 2a)

D:\Temp\BzrTest
 > bzr add
adding "Délégués parents de classe 2009_10.txt"
adding "Vidéo.txt"
adding "Çà ! N?m dé fîçhïèr tôrdù, @ pöür têstër... ? ~ ?[?]; #(?).txt"

D:\Temp\BzrTest
 > bcm "Adding funny file names..." # bcm is just a personal shortcut at the doskey level
Committing to: D:/Temp/BzrTest/
added Délégués parents de classe 2009_10.txt
added Vidéo.txt
added Çà ! N?m dé fîçhïèr tôrdù, @ pöür têstër... ? ~ ?[?]; #(?).txt
Committed revision 1.

D:\Temp\BzrTest
 > bzr log -v
------------------------------------------------------------
revno: 1
committer: PhiLho <PhiLho at gmx.net>
branch nick: BzrTest
timestamp: Fri 2011-04-29 11:15:54 +0200
message:
   Adding funny file names...
added:
   Délégués parents de classe 2009_10.txt
   Vidéo.txt
   Çà ! N?m dé fîçhïèr tôrdù, @ pöür têstër... ? ~ ?[?]; #(?).txt

D:\Temp\BzrTest
 > bzr log -v > lst
# Chars appear mangled in the text editor!

D:\Temp\BzrTest
 > chcp 65001
Page de codes active : 65001

D:\Temp\BzrTest
 > bzr log -v
bzr: warning: unknown terminal encoding cp65001.
   Using encoding cp1252 instead.
bzr: warning: unknown terminal encoding cp65001.
   Using encoding cp1252 instead.
bzr: warning: unknown terminal encoding cp65001.
   Using encoding cp1252 instead.
------------------------------------------------------------
revno: 1
committer: PhiLho <PhiLho at gmx.net>
branch nick: BzrTest
timestamp: Fri 2011-04-29 11:15:54 +0200
message:
   Adding funny file names...
added:
   Dlgus parents de classe 2009_10.txt
D:\Temp\BzrTest
 > dir
  Le volume dans le lecteur D s'appelle Data
  Le numéro de série du volume est 04BF-506F

  Répertoire de D:\Temp\BzrTest

29/04/2011  11:17    <REP>          .
29/04/2011  11:17    <REP>          ..
21/02/2007  18:24             1 252 Délégués parents de classe 2009_10.txt
29/04/2011  11:17               330 lst
10/03/2008  15:53             2 518 Vidéo.txt
03/12/2007  17:21             3 810 Çà ! Nœm dé fîçhïèr tôrdù, @ pöür têstër... よ ~ Œ[€]; 
#(囗).txt
                4 fichier(s)            7 910 octets
                2 Rép(s)  104 273 756 160 octets libres

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...

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --




More information about the bazaar mailing list