> I think we've discovered a bug in Pugs, but as I don't know that much > about UTF-8, I'd like to see the following confirmed first :). > # This is what *should* happen: > my $x = chr(0xE2)~chr(0x82)~chr(0xAC); > say $x.bytes; # 3 > say $x.chars; # 1 > > # This is what currently happens: > my $x = chr(0xE2)~chr(0x82)~chr(0xAC); > say $x.bytes; # 6 > say $x.chars; # 3
That doesn't make sense. If you read the first statement "my $x=..." out loud, you'll see it says "character 0xE2, then character 0x82, then character 0xAC". Three characters. On the other hand, my $x = chr(0x20AC); # Look ma, Unicode! say $x.bytes; #3 say $x.chars; #1 -- -Roie v2sw6+7CPhw5ln5pr4/6$ck2ma8+9u7/8LSw2l6Fi2e2+8t4TNDSb8/4Aen4+7g5Za22p7/8 [ http:www.hackerkey.com ]