question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mitmproxy should check LC_CTYPE before LANG when testing console environment

See original GitHub issue

When I run mitmproxy 0.9, I see:

% mitmproxy --version
mitmproxy 0.9
% mitmproxy
Error: mitmproxy requires a UTF console environment.
Set your LANG enviroment variable to something like en_US.UTF-8

But my console environment is UTF-8 already:

% locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

When I check the locale(1) manpage, it says that LC_ALL, if set, overrides LC_*, and that LANG is just a fallback for unset LC_* values. But every possible LC_* value other than LC_ALL is set, so there is no need to set either LC_ALL or LANG.

% uname -v
Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
jeremy-wcommented, Jan 17, 2017

@abit2: You need to change the process environment. This should work:

env LANG="C.UTF-8" mitmproxy
1reaction
j1anFencommented, Mar 28, 2018

vim /etc/profile export LANG=C.UTF-8 source /etc/profile

Read more comments on GitHub >

github_iconTop Results From Across the Web

mitmproxy should check LC_CTYPE before LANG when ...
I am facing the same problem: Error: mitmproxy requires a UTF console environment. Set your LANG enviroment variable to something like en_US.UTF ......
Read more >
Options - mitmproxy docs
Name Type Description # allow_hosts mitmproxy mitmdump mitmweb sequence of str Opposite of ‑‑ignore‑hosts... # client_replay mitmproxy mitmdump mitmweb sequence of str Replay client requests...
Read more >
How To: Use mitmproxy to read and modify HTTPS traffic
When the client opens an SSL/TLS connection to the secure web server, it verifies the server's identity by checking two conditions: First, ......
Read more >
Against All Odds
mitmproxy Error: mitmproxy requires a UTF console environment. Set your LANG enviroment variable to something like en_US.UTF-8.
Read more >
How to Man in the Middle HTTPS Using mitmproxy - Earthly Blog
mitmproxy is a command-line tool that acts as a HTTP and HTTPS proxy and records all the traffic. You can easily see what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found