THRIFT-1037 Proposed changes to support Silverlight, Windows Phone and AsyncCTP v3
Patch: Damian Mehers & Jens Geyer

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1211880 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs
index a35fcd3..ed6970e 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -841,7 +841,7 @@
 			if (reader.Peek() == QUOTE[0])
 			{
 				byte[] arr = ReadJSONString(true);
-				double dub = Double.Parse(utf8Encoding.GetString(arr), CultureInfo.InvariantCulture);
+				double dub = Double.Parse(utf8Encoding.GetString(arr,0,arr.Length), CultureInfo.InvariantCulture);
 
 				if (!context.EscapeNumbers() && !Double.IsNaN(dub) &&
 					!Double.IsInfinity(dub))
@@ -938,7 +938,8 @@
 											 "Message contained bad version.");
 			}
 
-			message.Name = utf8Encoding.GetString(ReadJSONString(false));
+            var buf = ReadJSONString(false);
+			message.Name = utf8Encoding.GetString(buf,0,buf.Length);
 			message.Type = (TMessageType)ReadJSONInteger();
 			message.SeqID = (int)ReadJSONInteger();
 			return message;
@@ -1059,7 +1060,8 @@
 
 		public override String ReadString()
 		{
-			return utf8Encoding.GetString(ReadJSONString(false));
+            var buf = ReadJSONString(false);
+			return utf8Encoding.GetString(buf,0,buf.Length);
 		}
 
 		public override byte[] ReadBinary()