hxUnicode

hxUnicode is a cross-platform library for manipulating Unicode string.
lib.haxe.org hxUnicode

Usage


hxUnicode supplies UnicodeTools and CombiningTools. Declaring them with the using keyword, you can use the functions as them of the String class.
using unicode.UnicodeTools;
using unicode.CombiningTools;

UnicodeTools


UnicodeTools manipulate each Unicode character.
"日本語".uLength() == 3
"русский".uCharAt(5) == "и"
"☃".uCodeAt(0) == 0x2603
"今日は雪が降りました".uIndexOf("雪") == 3

You can convert Code Points into a string.
(0x2600).uCodeToString() == "☀"
[0x3007, 0x4E00, 0x4E8C, 0x4E09].uToString() == "〇一二三"

You can validate Unicode strings with uIsValid or uValidate. uIsValid returns true when the given string is valid. uValidate() throws an Exception when the given string is invalid.

UnicodeIter


UnicodeIter is an iterator that returns each Unicode Code Point.

CombiningTools


CombiningTools manipulate each combining character sequence.
[0x304B, 0x309A].uToString().ucLength() == 1
"fʁɑ̃sɛ".ucLength() == 5

ucOrderingは結合文字を正規順序(Canonical Ordering)に並び替えた文字列を返します。

version #7444, modified 2010-01-02 09:46:55 by mandel59