Thrift-1131: C# JSON Protocol is unable to decode escaped characters in string
authorJake Farrell <jfarrell@apache.org>
Thu, 14 Apr 2011 14:30:25 +0000 (14:30 +0000)
committerJake Farrell <jfarrell@apache.org>
Thu, 14 Apr 2011 14:30:25 +0000 (14:30 +0000)
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

lib/csharp/src/Protocol/TJSONProtocol.cs

index 7c88f0f..5f6351f 100644 (file)
@@ -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,