<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><div><div style="overflow:auto"><div dir="ltr">It
would be nice if there would be an escape hatch for situations where
the value of locale.getpreferredencoding() can't be changed (eg: <a href="http://blog.ionelmc.ro/2014/06/19/just-another-day-using-python-3/" target="_blank">windows - try changing that to utf8</a>) in the form of an environment variable like PYTHONPREFERREDENCODING (or something like that). <br>
<br>The
idea is that it would override the default encoding for open() for
platforms/situations where it's infeasible to manually specify the
encoding to open (eg: lots of old code) or change locale to something
utf8-ish (windows).<br><br>I've found an <a href="http://grokbase.com/t/python/python-dev/116w24gdra/open-set-the-default-encoding-to-utf-8-in-python-3-3" target="_blank">old thread</a> about this problem but to my bewilderment no one considered using an environment variable.<br>
</div></div></div> </div><br clear="all"><div><div dir="ltr"><span style="font-family:trebuchet ms,sans-serif"><span style="color:rgb(51,51,51)"><br><font><span style="color:rgb(51,51,51)">Thanks,</span><br>
<span style="color:rgb(153,153,153)">-- Ionel</span></font></span><font><font style="color:rgb(153,153,153)"> M.</font></font><br>
</span></div></div>
</div>