Hi,

my $a='A';
$a ~~ s:perl5:g/A/{chr(65535)}/;
say $a.bytes;

Outputs "0". Why?

\uFFFF is not a legal unicode codepoint. chr(65535) should raise an exception of some type. So the above code does seem show a possible bug. But as that chr(65535) is an undefined char, who knows what the code is acually doing.

It seems, that it gives back 0 in the 0xE000-0xFFFF range. Do you still think, it's normal?


"Some Unicode code points are invalid and should not be used. [...] It can't be 0xFFFF or 0xFFFE, it can't be both <= 0xDFFF and >= 0xD800, and it can't be > 0x10FFFF and it can't be less than 0."

  http://www.elfdata.com/plugin/unicodefaqdata.html

Bye,
  Andras

Reply via email to