解决Hg在MacOSX leopard上的locale问题

简短说,因为重新在新mac上装mercurial,没有装macports也没有fink,这次也不想自己编,所以选择了预编译的package。但是后来发现报错!
我用的是http://mercurial.berkwood.com/这里的包,1.0.1的mercurial package,是08-05-25出的那个包。

line 373, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

那么,如何解决呢?这里找到了答案:
http://www.selenic.com/pipermail/mercurial/2007-October/015296.html
解决的方法就是在你的.profile加入下面这样的声明,如果你用的是bash的话。

export LC_ALL=es_ES.UTF-8
export LANG=es_ES.UTF-8

然后就工作正常了,如果想知道为什么,可以看看这里有更详细的原理介绍,LC_ALL是给字体字符集使用的环境变量。
http://www.madboa.com/geek/utf8/

结绳记事,希望有帮助。

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.