Add encoding detection
authorMatt Mackall <mpm@selenic.com>
Sun, 03 Dec 2006 16:16:33 -0600
changeset 3769 96095d9ff1f8
parent 3768 6ae3685be45d
child 3770 f96c158ea3a3
Add encoding detection
mercurial/util.py
--- a/mercurial/util.py	Sat Dec 02 22:41:05 2006 +0100
+++ b/mercurial/util.py	Sun Dec 03 16:16:33 2006 -0600
@@ -15,7 +15,9 @@
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
-demandload(globals(), "os threading time calendar ConfigParser")
+demandload(globals(), "os threading time calendar ConfigParser locale")
+
+_encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding()
 
 # used by parsedate
 defaultdateformats = ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M',