浏览代码

[python] fix haxe.io.Bytes#getString

now it deal beyond-BMP (astral) code points correctly.
Ryusei Yamaguchi 11 年之前
父节点
当前提交
cfe7718a9d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/haxe/io/Bytes.hx

+ 2 - 0
std/haxe/io/Bytes.hx

@@ -287,6 +287,8 @@ class Bytes {
 		try
 			return new String(b, pos, len, "UTF-8")
 		catch (e:Dynamic) throw e;
+		#elseif python
+		return python.Syntax.pythonCode("self.b[pos:pos+len].decode('UTF-8')");
 		#else
 		var s = "";
 		var b = b;