Perl-Sensitive Sunglasses | |
PerlMonks |
Re^5: Example of perluniintroby Anonymous Monk |
on Aug 18, 2012 at 07:22 UTC ( [id://988167]=note: print w/replies, xml ) | Need Help?? |
So, why "C" values could become greater than 255? this seems strange... Its all strange to me, I'm not joking From http://perldoc.perl.org/5.14.1/functions/pack.html
So trying that I get
So, yes, I think I agree, its a mistake , in that it should probably say You can find the bytes that make up a UTF-8 sequence with: And this seems to confirm that
update: It says in another part of perluniintro One way of peeking inside the internal encoding of Unicode characters is to use unpack("C*", ... to get the bytes of whatever the string encoding happens to be, or unpack("U0..", ...) to get the bytes of the UTF-8 encoding: So yeah, whatever perl's actual internal format that we shouldn't care about is, it is not utf8, and if you want the UTF8 bytes, you need U0C*, otherwise (it looks like) you get IV bytes
In Section
Seekers of Perl Wisdom
|
|