Use Unifill.uLength() in UTF8String get_length()

If the String isn't a valid UTF8 string haxe.Utf8.length() will throw a cryptic "Invalid UTF8" error while Unifill.uLength() will return 0
This commit is contained in:
MrCdK
2018-09-10 22:42:03 +02:00
committed by Joshua Granick
parent 98d8296c06
commit c384eb26d4

View File

@@ -359,7 +359,7 @@ abstract UTF8String(String) from String to String {
@:noCompletion private function get_length ():Int {
return this == null ? 0 : Utf8.length (this);
return this == null ? 0 : Unifill.uLength (this);
}