equal
deleted
inserted
replaced
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 """ |