From: Jake Farrell Date: Thu, 14 Apr 2011 14:30:25 +0000 (+0000) Subject: Thrift-1131: C# JSON Protocol is unable to decode escaped characters in string X-Git-Tag: 0.7.0~110 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=83693531db0893f59178991b20a0efb16a403004;p=common%2Fthrift.git Thrift-1131: C# JSON Protocol is unable to decode escaped characters in string Client lib: csharp Patch: Maciek Weksej C# JSON Protocol throws TProtocolException after meeting an escaped character in UTF8 string, this casts the value being read to avoid this. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1092282 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs index 7c88f0fb..5f6351f7 100644 --- a/lib/csharp/src/Protocol/TJSONProtocol.cs +++ b/lib/csharp/src/Protocol/TJSONProtocol.cs @@ -744,7 +744,7 @@ namespace Thrift.Protocol } else { - int off = Array.IndexOf(ESCAPE_CHARS, ch); + int off = Array.IndexOf(ESCAPE_CHARS, (char)ch); if (off == -1) { throw new TProtocolException(TProtocolException.INVALID_DATA,