Closed andrewcox closed 10 years ago
With TJSONProtocol, a string will be coerced to binary and TJSONProtocol will base64 encode it. When deserializing it will be base64 decoded and coerced back to string. So data isn't corrupted but just the base64 part is unnecessary?
1) Sure. Added a test for encoding/decoding a UTF8 test string. 2) Correct
And you're right, round-trip testing generally would have generally worked, even though we were improperly base64-encoding strings in TJSONProtocol. As long as both sides (read & write) happened using the broken assumption that string should always be handled using writeBinary/readBinary. However, only swift used this assumption so if TJSONProtocol data came from any other thrift implementation to swift, it would have gotten corrupted during decode, and if swift sent TJSONProtocol data to any other thrift implementation, it would have sent corrupted data.
LGTM
Code looks good to me. Just a few comments: