Internationalisation of bzr cli

John Arbash Meinel john at arbash-meinel.com
Fri Apr 29 09:38:24 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


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

We can know if the output is a tty or not (isatty()) that doesn't tell
us if we are redirecting to a file, or through a pager program like
"more" or "less". So we can tell:

bzr status
 from
bzr status > file

but we can't tell
bzr status > file
 from
bzr status | another-program


As for Windows. There *is* a pure Unicode interface that is
somehow/sometimes available, and if the user configures the terminal
with a Unicode aware font, it actually works pretty well. The issue is
it means changing the 'write to console' from being anything remotely
like "sys.stdout.write()" to "WriteConsoleW" (not sure on the name)
functions.

It also means writing *everything* including user-content that we try to
not interpret, to the Unicode stream (I think).

It just hasn't been high on the priority list, since you have tools like
Bazaar Explorer and QBzr available that do a much better job of it anyway.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk26hxAACgkQJdeBCYSNAANEPgCg0KZGiYmO3zxJk3xmd/gFMWRY
Y5cAoMzILTgPm39b4YBx5FmPuhAU4ROS
=adEV
-----END PGP SIGNATURE-----



More information about the bazaar mailing list