note
moritz
<p>There are two problems with your code. One is that you decode UTF-8 at the script/input level (with <c>use utf8;</c> and [doc://open] with <c>:encoding(UTF-8)</c>), but you don't encode at the output level. A</p>
<code>
binmode STDOUT, ':encoding(UTF-8)';
</code>
<p>should help. [http://perlgeek.de/en/article/encodings-and-unicode|read more].</p>
<p>The second (potential) problems is that you open all files as UTF-8, but if some of them aren't actually UTF-8 encoded, you'll get [wp://Mojibake].</p>
<p>Before you decode a file as UTF-8, you need to find out its character encoding. If you have no additional meta data that can help you find out the character encoding, you can [http://www.w3.org/International/O-charset|look for clues inside the document], or use something like [mod://Encode::Guess] to auto-detect the character encoding. (But beware that these methods are also error-prone).</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-616540">
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
</div></div>
1074106
1074106