Front page | perl.perl6.internals |
Postings from June 2001
The internal string API
Thread Next
From:
Dan Sugalski
Date:
June 19, 2001 11:17
Subject:
The internal string API
Message ID:
5.1.0.14.0.20010619140500.0205cfb0@24.8.96.48
Since we're going to try and take a shot at being encoding-neutral in the
core, we're going to need some form of string API so the core can actually
manipulate string data. I'm thinking we'll need to be able to at least do
this with string:
* Convert from and to UTF-32
* lengths in bytes, characters, and possibly glyphs
* character size (with the variable length ones reporting in negative numbers)
* get and set the locale (This might not be the spot for this)
* normalize (a noop for non-Unicode data)
* Get the encoding name
* Do a substr operation by character and glyph
I don't know if we want to treat encoding and data format separately--it
would seem to make sense to be able to have a string tell us it's
Unicode/UTF-32/Korean rather than just UTF-32/Korean, since I don't see why
it wouldn't be allowable to use the UTF-8 or UTF-16 encoding on non-Unicode
data. (Not that it'd necessarily be all that useful, and I can see just not
allowing it)
Anyone think of anything else that ought to be included? I'm going to throw
together a string API PDD in the next few days on it. We can always add to
it, of course, but it doesn't hurt to get things set up front.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
dan@sidhe.org have teddy bears and even
teddy bears get drunk
Thread Next
-
The internal string API
by Dan Sugalski