[Bug 1048324] Reference to perl (5.18.1-288.fc20.x86_64) utf8 string is Invalid Argument to open

bugzilla at redhat.com bugzilla at redhat.com
Thu Jan 9 05:09:34 UTC 2014


https://bugzilla.redhat.com/show_bug.cgi?id=1048324



--- Comment #2 from Ross Tyler <rossetyler at gmail.com> ---
Thanks for the explanation and link.

For the benefit of others,
What is wrong with:

perl -we 'my $s = qq{\x{2019}}; open(my $f, q{<}, \$s) or die $!'

is that it would make assumptions about the perl internal string representation
that the language does not guarantee.

Instead an explicit encoding/decoding must be done:

perl -we 'use Encode; my $s = encode(q{utf8}, qq{\x{2019}}); open(my $f,
q{<:utf8}, \$s) or die $!'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=Zp8JaoyLyV&a=cc_unsubscribe



More information about the perl-devel mailing list