Gunnar Hjalmarsson wrote:
What assumptions does Perl make regarding input file (i.e., the
program/script file) encoding?
AFAIK, it just converts the bytes into Perl's internal format, but it
does not assume anything (at least not by default) with respect to the
character encoding.
Is it so that string literals in Perl are byte arrays in fact?
String literals in a Perl script are byte *strings* until decoded.
Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html)
one can however make them parsed (decoded) (provided they are valid UTF-8).
It's all about UTF8 flag:
http://perldoc.perl.org/Encode.html#The-UTF8-flag .
STF
=======================================================================
http://eisenbits.homelinux.net/~stf/
OpenPGP: DFD9 0146 3794 9CF6 17EA D63F DBF5 8AA8 3B31 FE8A
=======================================================================
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/