in reply to Pragma to handle unicode characters

Have you tried the -C option or, equivalently, the PERL_UNICODE environment variable?

It seems to help, but I don't have enough experience with unicode strings to really test it properly.

$ perl -CSDAL -e 'print "the utf8 flag is ", utf8::is_utf8(shift) ? "o +n" : "off", " for command-line arguments\n"' hi...the utf8 flag is on + for command-line arguments
$ perl -e 'print "the utf8 flag is ", utf8::is_utf8(shift) ? "o +n" : "off", " for command-line arguments\n"' hi... the utf8 flag is off for command-line arguments

Replies are listed 'Best First'.
Re^2: Pragma to handle unicode characters
by wanradt (Scribe) on Dec 22, 2008 at 09:01 UTC
    Have you tried the -C option or, equivalently, the PERL_UNICODE environment variable?
    No, i was not, now i tried and it helped me. After setting PERL_UNICODE=39 i still (just) need set in my script
    use utf8; use open ':std', ':encoding(UTF-8)';
    Thank you, it anwers my first question!

    It still does not affect @ENV variables, as applied fellow Almut.
    Nġnda, WK
      You might want to try PERL_UNICODE=63. I think that will let you drop the 'use open' line.