瀏覽代碼

[java] fixes charCodeAt for surrogate characters, matches the c# behaviour

frabbit 9 年之前
父節點
當前提交
e2d4dab194
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/java/internal/StringExt.hx

+ 1 - 1
std/java/internal/StringExt.hx

@@ -42,7 +42,7 @@ private typedef NativeString = String;
 			if ( index >= me.length() || index < 0 )
 				return null;
 			else
-				return me.codePointAt(index);
+				return (int) me.charAt(index);
 	')
 	public static function charCodeAt(me:NativeString, index:Int):Null<Int>
 	{