# New Ticket Created by  Sam S. 
# Please include the string:  [perl #124185]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=124185 >


Trying to print a Unicode codepoint like 55296 can fail with multiple different 
failure modes, none of which are very helpful, and at least one of which 
(segfaullt) is a bug:

 $ perl6 -e 'say 55296.chr'
 Iteration past end of grapheme iterator
   in method print at src/gen/m-CORE.setting:17885
   in sub say at src/gen/m-CORE.setting:18644
   in block <unit> at -e:1

 $ perl6 -e 'say "A" ~ 55296.chr'
 Error encoding UTF-8 string near grapheme position 0 with codepoint 65
   in method print at src/gen/m-CORE.setting:17885
   in sub say at src/gen/m-CORE.setting:18644
   in block <unit> at -e:1

 $ perl6 -e 'say "A", 55296.chr'
 A/home/smls/.rakudobrew/bin/perl6: line 2: 20876 Segmentation fault      (core 
dumped) ...


Discussion:

 moritz:    well, it could die with "Illegal codepoint"
 moritz:    or something like that
 moritz:    but everything else is either a bug, or an LTA error (which is also 
a bug, IMHO)
 
 TimToady:  m: say uniname(55296)
 camelia:   rakudo-moar 9210cc: OUTPUT«<Non Private Use High Surrogate>␤»
 
 smls:      Does that mean it should print "Invalid code point?" for that
 TimToady:  maybe more "No true codepoint would ever be a surrogate!"

Reply via email to