aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-06-09 11:20:02 +1200
committerAldo Cortesi <aldo@nullcube.com>2013-06-09 11:20:02 +1200
commit9f6657727b9f1639970beb6052837a4ab6c33299 (patch)
tree39ff58237ce4557507313b4915018ace0d2d00b5 /mitmproxy
parent7ef68b5a13ac41c0a180b891c5331c8526c1e7f4 (diff)
downloadmitmproxy-9f6657727b9f1639970beb6052837a4ab6c33299.tar.gz
mitmproxy-9f6657727b9f1639970beb6052837a4ab6c33299.tar.bz2
mitmproxy-9f6657727b9f1639970beb6052837a4ab6c33299.zip
Make UTF environment detection more robust.
Fixes #125
Diffstat (limited to 'mitmproxy')
-rwxr-xr-xmitmproxy6
1 files changed, 4 insertions, 2 deletions
diff --git a/mitmproxy b/mitmproxy
index 2d773c02..f8b42444 100755
--- a/mitmproxy
+++ b/mitmproxy
@@ -62,12 +62,14 @@ if __name__ == '__main__':
opts.debug = options.debug
opts.palette = options.palette
- if "utf" not in os.environ.get("LANG", "").lower():
+ spec = ""
+ for i in ["LANG", "LC_CTYPE", "LC_ALL"]:
+ spec += os.environ.get(i, "").lower()
+ if "utf" not in spec:
print >> sys.stderr, "Error: mitmproxy requires a UTF console environment."
print >> sys.stderr, "Set your LANG enviroment variable to something like en_US.UTF-8"
sys.exit(1)
-
m = console.ConsoleMaster(server, opts)
try:
m.run()