in reply to Re^3: question about Encode::decode('iso-8859-1', ...)
in thread question about Encode::decode('iso-8859-1', ...)
This is a surprising effect of the utf8::upgrade/downgrade functions
What surprising effect? Their purpose is to convert a scalar's internal encoding, and I used them for that purpose.
If it helps clear up some confusion, change
utf8::downgrade my $bin_dn = $bin; # UTF8=0 utf8::upgrade my $bin_up = $bin; # UTF8=1
to
my $bin_dn = $bin; # UTF8=0 chop my $bin_up = $bin . "\x{2660}"; # UTF8=1
Practical use for utf8::upgrade: Ensure "Unicode semantics" are used in regex matches. (But note that work is being done to remove such dependencies on this internal information.)
Practical use for utf8::downgrade: Ensure a string is a string of bytes (only contains chars 0-255), such as in Encode::decode and in Net::SFTP::Foreign::write.
|
|---|