THRIFT-3375 Python TJSONProtocol encodes utf8 string values in an incompatible way
This closes #642
diff --git a/lib/py/src/protocol/TJSONProtocol.py b/lib/py/src/protocol/TJSONProtocol.py
index d270ce8..9e25f67 100644
--- a/lib/py/src/protocol/TJSONProtocol.py
+++ b/lib/py/src/protocol/TJSONProtocol.py
@@ -174,13 +174,13 @@
def writeJSONString(self, string):
self.context.write()
- self.trans.write(json.dumps(string))
+ self.trans.write(json.dumps(string, ensure_ascii=False))
def writeJSONNumber(self, number):
self.context.write()
jsNumber = str(number)
if self.context.escapeNum():
- jsNumber = "%s%s%s" % (QUOTE, jsNumber, QUOTE)
+ jsNumber = "%s%s%s" % (QUOTE, jsNumber, QUOTE)
self.trans.write(jsNumber)
def writeJSONBase64(self, binary):