# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #48108]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48108 >


If ICU isn't present, Parrot's C<downcase> opcode always throws
an exception.  It does this even if the string contains codepoints
only in the ascii and/or iso-8859-1 range.

For example:

    $ cat x.pir
    .sub main :main
        $S0 = unicode:"hello world"
        $S1 = downcase $S0
        say $S1
    .end

    $ ./parrot x.pir
    no ICU lib loaded
    current instr.: 'main' pc 3 (x.pir:3)

This may cause a problem for Perl 6 programs, since the source
code is always read as Unicode, and particularly affects the 
C< « > and C< » > characters (codepoints U+00ab and U+00bb).

So far the major place I've run into this is in PGE, and I have
a workaround there [1], but it will certainly crop up in many
other places as we get more Perl 6 programs going.

Pm

[1]  PGE only has to downcase a single character at a time,
     so instead of doing "$S1 = downcase $S0" it can cheat with

         $I0 = ord $S0
         $S1 = chr $I0
         $S1 = downcase $S1

     This works because chr with codepoints < 256 produces
     strings as either ascii or iso-8859-1, and downcase can
     work with that.

Reply via email to