Mac and Python Error for hg

I was trying with hg (hg is a distributed
version control ) for my Firefox translation Project. Python was installed previously on macBook
(Mac OS X 10.5.4), but while running hg command, it showed error like following:
amanpreet-singh-brars-macbook:~ Preet$ hg ****
Traceback (most recent call last):
File “/usr/local/bin/hg”, line 18, in
File “/Library/Python/2.5/site-packages/mercurial/”, line 74, in __getattribute__
File “/Library/Python/2.5/site-packages/mercurial/”, line 46, in _load
mod = _origimport(head, globals, locals)
File “/Library/Python/2.5/site-packages/mercurial/”, line 33, in
_encoding = locale.getlocale()[1]
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/”, line 460, in getlocale
return _parse_localename(localename)
File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/”, line 373, in _parse_localename
raise ValueError, ‘unknown locale: %s’ % localename
ValueError: unknown locale: UTF-8
last line was making some know hint, something wrong with locale setting.

Tried to set various setting from terminal, finally it is fixed and here are commands I used

$ printenv LANG

$ export LC_ALL=en_US.UTF-8

$ export LANG=en_US.UTF-8
if you want those changes each time you log-in then make ~/.bashrc file and add
those lines there.

Note: I have not reboot my machine after making those changes, please don’t know
whether work or not;-)