Perl: the Markov chain saw | |
PerlMonks |
Re^2: Default encoding rules leave me puzzled... (use open qw/ :std :locale /;by kzwix (Sexton) |
on Jun 20, 2014 at 09:36 UTC ( [id://1090597]=note: print w/replies, xml ) | Need Help?? |
Sorry, I realize I wasn't specific enough: So, is there some place where it is explicitly stated what is converted by perl, in a transparent manner, and what isn't ? Furthermore, even though I didn't Encode or Decode the streams, shouldn't it "just work", if the scalar value is specified in UTF-8 (because the file is encoded as such), and Perl is AWARE that it is UTF-8 (because of 'use utf8;'), and Perl stores it internally in UTF-8, and the expected output format is UTF-8 too ? I'm pretty sure there is a catch I haven't figured out, there, but pointing it to me, even if obvious, could help. Thanks ! EDIT: I've run a short test, using a Latin-1 terminal (this test script is fully encoded in UTF-8):
Using my Latin-1 terminal, I displayed the source file, and, sure enough, the contents were garbled (2 strange bytes for each accentuated character, which confirmed me the file was truly UTF-8), then I ran the script. And I got a perfect display.
In Section
Seekers of Perl Wisdom
|
|