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 7c88f0f..5f6351f 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -744,7 +744,7 @@
}
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,