mercurial/util.py
changeset 4057 3600b84656d3
parent 4055 e37786b29bed
child 4059 431f3c1d3a37
child 4067 c620376b8fd6
equal deleted inserted replaced
4056:f1622b4f467d 4057:3600b84656d3
    15 from i18n import gettext as _
    15 from i18n import gettext as _
    16 from demandload import *
    16 from demandload import *
    17 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
    17 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
    18 demandload(globals(), "os threading time calendar ConfigParser locale glob")
    18 demandload(globals(), "os threading time calendar ConfigParser locale glob")
    19 
    19 
    20 _encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding() \
    20 try:
    21             or "ascii"
    21     _encoding = os.environ.get("HGENCODING") or locale.getpreferredencoding() \
       
    22                 or "ascii"
       
    23 except locale.Error:
       
    24     _encoding = 'ascii'
    22 _encodingmode = os.environ.get("HGENCODINGMODE", "strict")
    25 _encodingmode = os.environ.get("HGENCODINGMODE", "strict")
    23 _fallbackencoding = 'ISO-8859-1'
    26 _fallbackencoding = 'ISO-8859-1'
    24 
    27 
    25 def tolocal(s):
    28 def tolocal(s):
    26     """
    29     """