<div dir="ltr"><a href="http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/">http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/</a><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 25, 2014 at 3:24 AM, Travis Cardwell <span dir="ltr"><<a href="mailto:travis.cardwell@extellisys.com" target="_blank">travis.cardwell@extellisys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2014年04月25日 16:25, Christopher Allen wrote:<br>
> I'm going to disagree for a different reason. The transition to Python 3<br>
> improved unicode support in some respects, but utterly gutted the<br>
> previously excellent codec support. Now you can't really handle arbitrary<br>
> source/destination encodings of text without treating everything as if they<br>
> were bytes. Really bad.<br>
<br>
</div>Perhaps I am misunderstanding, but, from my experience, Python 3 still has<br>
excellent codec support:<br>
<br>
<a href="https://docs.python.org/3.4/library/codecs.html" target="_blank">https://docs.python.org/3.4/library/codecs.html</a><br>
<br>
When reading from a file, the source encoding can be passed to the `open`<br>
function so that it handles transcoding for you.  When writing to a file,<br>
the destination encoding can similarly be specified to `open`.  When<br>
dealing with other sources/destinations, data must be read/written as<br>
bytes, but content can be encoded/decoded as necessary using the functions<br>
in the codecs module.<br>
<br>
Haskell has excellent codec support thanks to ICU:<br>
<br>
<a href="http://hackage.haskell.org/package/text-icu" target="_blank">http://hackage.haskell.org/package/text-icu</a><br>
<br>
The contents of the `Data.Text.ICU.Convert` module can be used to convert<br>
between codecs.  For reference, here is a list of supported codecs:<br>
<br>
<a href="http://demo.icu-project.org/icu-bin/convexp" target="_blank">http://demo.icu-project.org/icu-bin/convexp</a><br>
<br>
Cheers,<br>
<br>
Travis<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>