puts \u30b3\u30fc\u30d2\u30fc
Working... because puts is just iso-8859-01, and the unicode was just unicode. Once I started trying to do mix and match, I started getting a lot of runtime exceptions. I can't seem to find a combination of implemented methods at the moment that'll let me limp by.
There are 30 unimplmented methods in charset/unicode.h (and a few in ascii & binary)- The one that's holding me up right now is:
oolong:~/research/parrot coke$ cat foo.pir
.sub main @MAIN
$S1 = chr 0x30b3
$I1 = index $S1, "a"
.end
oolong:~/research/parrot coke$ ./parrot foo.pir
unimplemented unicode
in file 'foo.pir' near line 3
Any help would be greatly appreciated.
> There are 30 unimplmented methods in charset/unicode.h (and a few in
> ascii & binary)
Yeah. Please folks have a look at it. It's not a big deal. To access one
codepoint use ENCODING_GET_CODEPOINT for more in a row use the
String_iter. There should be enough examples for it already in
implemented functions.
> .sub main @MAIN
> $S1 = chr 0x30b3
> $I1 = index $S1, "a"
> .end
Ok. I've implemented the mixed_cs_index function. It's highly untested
and might contain bugs. Tests welcome.
Some more remarks:
- some string functions have C<const STRING *src> - most don't
- this inconsistency is spreading over to charset and encoding functions
too
- I'd like to have a common policy WRT the constness of items
- OTOH PMC*src arguments are never declared const
and
- binary strings don't have string_index - should they have one?
leo