lua-users home
lua-l archive

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


I've just put ICU4Lua 0.12A up on LuaForge. The main change from 0.11A
is in adding the rest of the string functions (excluding string.dump)
to icu.utf8 and icu.ustring:
	icu.ustring.match
	icu.ustring.gmatch
	icu.ustring.find
	icu.ustring.gsub
	icu.ustring.format
	icu.utf8.match
	icu.utf8.gmatch
	icu.utf8.find
	icu.utf8.gsub
	icu.utf8.format

I'd really appreciate anyone with a comprehensive set of tests for
these functions trying them out and let me know if they find any
problems - fatal errors are obviously the most important but I'd also
like to know about any (possibly subtle) ways they don't quite act
like their counterpart in the string table.

Also in this release, comparison functions have been added:
	icu.ustring.lessthan
	icu.ustring.lessorequal
	icu.ustring.equals
	icu.utf8.lessthan
	icu.utf8.lessorequal
	icu.utf8.equals

You can now also use the <, >, <= and >= operators to compare
ustrings. This also means that you can sort an array of ustrings using
table.sort - to sort an array of UTF-8 encoded strings, pass
icu.utf8.lessthan as the second parameter. (Remember, these
comparisons are still all based on codepoint-wise numerical
comparisons, not full collation.)

Finally, I've added an identification function for testing that a
given value is a ustring (returns true/false) as type() will only
return 'userdata':
	icu.ustring.isustring

Thanks for reading, I welcome any comments.

-Duncan