Author: jfarrell
Date: Thu Apr 14 14:30:25 2011
New Revision: 1092282

URL: http://svn.apache.org/viewvc?rev=1092282&view=rev
Log:
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.


Modified:
    thrift/branches/0.6.x/lib/csharp/src/Protocol/TJSONProtocol.cs
    thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs

Modified: thrift/branches/0.6.x/lib/csharp/src/Protocol/TJSONProtocol.cs
URL: 
http://svn.apache.org/viewvc/thrift/branches/0.6.x/lib/csharp/src/Protocol/TJSONProtocol.cs?rev=1092282&r1=1092281&r2=1092282&view=diff
==============================================================================
--- thrift/branches/0.6.x/lib/csharp/src/Protocol/TJSONProtocol.cs (original)
+++ thrift/branches/0.6.x/lib/csharp/src/Protocol/TJSONProtocol.cs Thu Apr 14 
14:30:25 2011
@@ -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,

Modified: thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs
URL: 
http://svn.apache.org/viewvc/thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs?rev=1092282&r1=1092281&r2=1092282&view=diff
==============================================================================
--- thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs (original)
+++ thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs Thu Apr 14 14:30:25 
2011
@@ -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,


Reply via email to