|
@@ -44,6 +44,17 @@ haxe.Utf8.compare(haxe.Utf8.sub(str, 1, 0), "") == 0;
|
|
|
// unspecify outside of range Utf8.sub
|
|
|
// haxe.Utf8.compare(haxe.Utf8.sub(str, 9, 0), "") == 0;
|
|
|
|
|
|
+#if (neko || php || cpp || lua || macro)
|
|
|
+haxe.Utf8.validate("\xf0\xa9\xb8\xbd\xe3\x81\x82\xc3\xab\x61") == true;
|
|
|
+haxe.Utf8.validate("\xed\x9f\xbf") == true;
|
|
|
+haxe.Utf8.validate("\xee\x80\x80") == true;
|
|
|
+haxe.Utf8.validate("\xf4\x8f\xbf\xbf") == true;
|
|
|
+haxe.Utf8.validate("\xf0\xa9\xb8\xbd\xe3\x81\xc3\xab\x61") == false;
|
|
|
+haxe.Utf8.validate("\xc0\xaf") == false; // redundant sequence
|
|
|
+haxe.Utf8.validate("\xed\xa0\x80") == false; // surrogate byte sequence
|
|
|
+haxe.Utf8.validate("\xed\xbf\xbf") == false; // surrogate byte sequence
|
|
|
+haxe.Utf8.validate("\xf4\x90\x80\x80") == false; // U+110000
|
|
|
+#end
|
|
|
|
|
|
#if php
|
|
|
}
|