Răsfoiți Sursa

[python] use 'replace' mode

this behavior is as same as C# and Java
Ryusei Yamaguchi 11 ani în urmă
părinte
comite
e60cf902d7
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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")
 		catch (e:Dynamic) throw e;
 		#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
 		var s = "";
 		var b = b;