default fsenc patch
songofacandy at gmail.com
Wed Jan 25 01:49:25 UTC 2012
On Wed, Jan 25, 2012 at 9:51 AM, Martin Pool <mbp at canonical.com> wrote:
> On 24 January 2012 20:14, INADA Naoki <songofacandy at gmail.com> wrote:
>> I sometimes use bzr on Linux without locale. I can write non-ascii comment with
>> vim but bzr doesn't accept it.
> I guess if you do set the locale it will be ok?
"Set the locale" is not easy for me. Our server is built minimal way
to boot from network
and don't have any locale.
$ export LANG=en_US.utf8
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Python 2.7.2 (default, Aug 18 2011, 15:38:34)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>> I think get_user_encoding() should also be 'utf-8' by default.
>> At least, bzr should provide a way to override user encoding. (e.g.
>> BZR_USER_ENCODING envvar)
> I think we can do that (there may be a bug for it). For filenames it
> is harder to override what Python thinks the encoding ought to be.
OK, I'll write patch and send merge request before 2.5rc1.
Supporting utf8 filename and commit message on machine without locale
is very nice to me.
> vim apparently also has some issues with non-locale-encoded filenames
> There are more dimensions on which people may want to vary (or have to
> vary) than Unix's concept of locale can really capture: you might want
> to write your commit message in utf-8, have filenames in euc, and have
> the text interface just run in C... But, even beyond just needing to
> implement those variations, we are a bit constrained what Python will
> actually let us implement.
> Anyhow, on the specific thing of this patch, of defaulting to utf-8,
> if gz feels we should leave it in, that's ok with me. It should only
> be active in fairly edge cases of having non-ascii names and an
> explicitly or implicitly ascii locale.
INADA Naoki <songofacandy at gmail.com>
More information about the bazaar