浏览代码

[python] use 'replace' mode

this behavior is as same as C# and Java
Ryusei Yamaguchi 11 年之前
父节点
当前提交
e60cf902d7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/haxe/io/Bytes.hx

+ 1 - 1
std/haxe/io/Bytes.hx

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