lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Dec 04, 2006 at 07:10:21PM +0000, David Given wrote:
> It's rather more low-level than what I want --- most of the functions return
> byte offsets rather than character offsets --- but it should be entirely
> possible to wrap it up in a string-lookalike library that uses grapheme counts
> throughout.

Out of curiosity, what use is that?  In particular, if a function
returns a character offset, and you want to use it to address the string,
you have to convert it to a byte offset--which is an expensive operation.
I've used UTF-8 for years, and I can't remember the last time I wanted
a character offset.  (Even if you use wide strings, you still don't
get those directly, due to combining characters.)

-- 
Glenn Maynard