<?xml version="1.0" encoding="windows-1252"?>
<node id="838885" title="Re^3: DWIM with non ASCII characters" created="2010-05-07 03:58:54" updated="2010-05-07 03:58:54">
<type id="11">
note</type>
<author id="616540">
moritz</author>
<data>
<field name="doctext">
&lt;blockquote&gt;Why use utf8;? As I understand the documentation, its purpose is to enable the source code to be in UTF-8&lt;/blockquote&gt;

&lt;p&gt;Yes, that way you avoid concatenating decoded and non-decoded strings.

&lt;p&gt;Of course it requires your script to be actually stored in UTF-8. But since the more general solution (use [doc://encoding] $your_encoding) is severly broken (wrt to [doc://perlsub|AUTOLOAD], thread safety and other issues), that's currently the only sane way to store non-ASCII Perl programs.

&lt;p&gt;As for the rest, I can only agree to what [ikegami] wrote; using IO layers is much more convenient than using encode() and decode() on every IO operation. More importantly since there are fewer spots you have to care about encoding, the probability of forgetting it somewhere (and getting [wp://Mojibake] in response) is much lower.


&lt;div class="pmsig"&gt;&lt;div class="pmsig-616540"&gt;
[http://perl6.org/|Perl 6] - links to (nearly) everything that is Perl 6.
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
838867</field>
<field name="parent_node">
838883</field>
</data>
</node>
