develooper Front page | perl.perl6.internals | Postings from June 2001

The internal string API

Thread Next
Dan Sugalski
June 19, 2001 11:17
The internal string API
Message ID:
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.


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                      teddy bears get drunk

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About