You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
Deserialize("[2]")
What is the expected output? What do you see instead?
List or Array with value 2
What version of the product are you using? On what operating system?
3.1.1.283
Please provide any additional information below.
Any expression starting with [ is considered a numeric expression. The problem
is solved by providing a space as the first character
Original issue reported on code.google.com by 0Su...@gmail.com on 23 Aug 2013 at 6:49
The text was updated successfully, but these errors were encountered:
I don't understand what the issue is. Can you give more of a code sample?
With what type are you constructing the serializer? The 2 is a numeric
expression, inside the [] it will be an array.
Original comment by elliott....@gmail.com on 24 Aug 2013 at 2:46
I feel the framework is treating any string starting with [ and not having a ,
as a numeric expression. But I may be wrong, please look at the code samples
below.
Serializer s = new Serializer(typeof(List<int>));
List<int> x = (List<int>)s.Deserialize("[2]"); //gives me a numeric expression
error
List<int> x = (List<int>)s.Deserialize(" [2]"); //works as expected
Serializer s = new Serializer(typeof(List<String>));
List<String> x = (List<String>)s.Deserialize("[\"2\"]"); //gives me a numeric
expression error
List<String> x = (List<String>)s.Deserialize(" [\"2\"]"); //works as expected
Somehow a simple fix of adding a " "(space) in front solves the problem.
Original comment by 0Su...@gmail.com on 24 Aug 2013 at 5:27
Original issue reported on code.google.com by
0Su...@gmail.com
on 23 Aug 2013 at 6:49The text was updated successfully, but these errors were encountered: