On a possibly related note: for systems that *do* have ICU,
concatenating a unicode: string with an ascii: or unicode:
string appears to result in a different encoding than concatenating
with iso-8859-1. Thus:
$S0 = unicode:"A"
$S1 = ascii:"B"
$S2 = concat $S0, $S1
print $S2 # outputs "AB"
$S0 = unicode:"A"
$S1 = unicode:"B"
$S2 = concat $S0, $S1
print $S2 # outputs "AB"
$S0 = unicode:"A"
$S1 = iso-8859-1:"B"
$S2 = concat $S0, $S1
print $S2 # outputs "A\x00B\x00"
This particular behavior isn't necessarily a bug, but it is
at least somewhat unexpected.
Pm
Found this bug while doing stuff --without-icu today...
Concatenation of a unicode string with an ASCII string
works even if ICU isn't available.
Concatenation of a unicode string with a Unicode string
works even if ICU isn't available.
Concatenation of a unicode string with an iso-8859-1 string
fails with "no ICU lib loaded" if ICU isn't available.
Sample program:
$ cat x.pir
.sub main
# works
$S0 = unicode:"A"
$S1 = ascii:"B"
$S2 = concat $S0, $S1
print $S2
print "\n"
# works
$S0 = unicode:"A"
$S1 = unicode:"B"
$S2 = concat $S0, $S1
print $S2
print "\n"
# fails
$S0 = unicode:"A"
$S1 = iso-8859-1:"B"
$S2 = concat $S0, $S1
print $S2
print "\n"
.end
$ ./parrot x.pir
AB
AB
no ICU lib loaded
current instr.: 'main' pc 34 (x.pir:16)
$
I'll add this as a test when I have the RT#.
Pm