Hey all.
This is my first working version of chr(i, s|sc) and ord(s, i|ic). It's
not nearly as clean as I'd like it. It's a lot more complicated and
low-level then I'd like. It is tested only on my system with INTVAL being a
long.
I'd be very interested in better tests, or ideas for a better implementation.
Current limitations:
- ord works on native strings only if a character is 8 bits or the size of
an INTVAL.
- both ord and chr only work for characters that fit in the Basic
Multilingual Plane (this shouldn't be a problem until around 2003, when
Unicode 2.0 starts introducing characters above this)
- Both assume that the byteorder of an INTVAL is the same as a utf32
character. (I think the core string code does the same thing, though.)
-=- James Mastros
-=- James Mastros