Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl, unicode...

4 views
Skip to first unread message

William Coleda

unread,
Apr 5, 2005, 9:57:59 PM4/5/05
to Perl 6 Internals
I've been trying to add unicode support into Tcl... adding the parser support worked fine, so that I was able (in my sandbox) to get:

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.

Leopold Toetsch

unread,
Apr 6, 2005, 6:27:58 AM4/6/05
to William Coleda, perl6-i...@perl.org
William Coleda <wi...@coleda.com> wrote:

> 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

0 new messages