소스 검색

Merge pull request #3095 from mandel59/python-bytes-bug

[python] fix haxe.io.Bytes#getString
frabbit 11 년 전
부모
커밋
869d20b5d6
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','replace')");
 		#else
 		var s = "";
 		var b = b;