aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-05-13 21:41:16 +1200
committerAldo Cortesi <aldo@nullcube.com>2013-05-13 21:41:16 +1200
commitd86b7c7f77ca67514da50854f8d44149dee431d1 (patch)
treeeaa76cda58a30f7f99beb2870a75cb67b3499d0b
parent11cc48ca255bb71886d85aeee7df941ae1bcafba (diff)
downloadmitmproxy-d86b7c7f77ca67514da50854f8d44149dee431d1.tar.gz
mitmproxy-d86b7c7f77ca67514da50854f8d44149dee431d1.tar.bz2
mitmproxy-d86b7c7f77ca67514da50854f8d44149dee431d1.zip
Prin an error when mitmproxy runs in a non-UTF environment.
-rwxr-xr-xmitmproxy8
1 files changed, 7 insertions, 1 deletions
diff --git a/mitmproxy b/mitmproxy
index b1e22fac..e4d72ed8 100755
--- a/mitmproxy
+++ b/mitmproxy
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import sys, argparse
+import sys, argparse, os
from libmproxy import proxy, console, cmdline, version
from libmproxy.console import palettes
@@ -62,6 +62,12 @@ if __name__ == '__main__':
opts.debug = options.debug
opts.palette = options.palette
+ if "utf" not in os.environ.get("LANG", "").lower():
+ 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()