I am generating a json object,
{
\"number\":0100
}
When this object is deserialized in C# using Newtonsoft.Json, 0100 i
I've looked at JsonTextReader.ParseNumber()
(the method where the "magic" of number reading happen). I'll say that it isn't doable. The octal case is especially handled
bool flag2 = c == '0' ...
and then
long value2 = text2.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ?
Convert.ToInt64(text2, 16) :
Convert.ToInt64(text2, 8); // Here OCTAL!!!
I haven't found any way to override this method (other than re-writing all the Read()
method that does everything in Json parsing)