Browse Source

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

frabbit 8 years ago
parent
commit
e2d4dab194
1 changed files with 1 additions and 1 deletions
  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 )
 			if ( index >= me.length() || index < 0 )
 				return null;
 				return null;
 			else
 			else
-				return me.codePointAt(index);
+				return (int) me.charAt(index);
 	')
 	')
 	public static function charCodeAt(me:NativeString, index:Int):Null<Int>
 	public static function charCodeAt(me:NativeString, index:Int):Null<Int>
 	{
 	{