Error
An unhandled exception of type 'Newtonsoft.Json.JsonReaderException' occurred in System.Private.CoreLib.dll
Unexpected character encountered while parsing value: S. Path '', line 0, position 0.
The json
{
"Australia":"36",
"Austria":"12",
"Belgium":"2",
"Bulgaria":"15",
"Canada":"37",
"China,mainland":"39",
"Croatia":"21",
"Cyprus":"16",
"Czech Republic":"29",
"Denmark":"10",
"Estonia":"17",
"Finland":"9",
"France":"4",
"Germany":"3",
"Greece":"18",
"Hong Kong SAR":"44",
"Hungary":"19",
"Ireland":"20",
"Italy":"7",
"Japan":"40",
"Latvia":"22",
"Liechtenstein":"43",
"Lithuania":"24",
"Luxembourg":"23",
"Malta":"25",
"Monaco":"42",
"New Zealand":"38",
"Norway":"32",
"Poland":"8",
"Portugal":"14",
"Romania":"26",
"Singapore":"47",
"Slovakia":"28",
"Slovenia":"27",
"Spain":"6",
"Sweden":"5",
"Switzerland":"41",
"The Netherlands":"1",
"United Arab Emirates":"35",
"United Kingdom":"13",
"United States":"30"
}
My string is saved on a Properties.Resources
inside my project. Running this makes the program crash:
var test= JsonConvert.DeserializeObject<Dictionary<string, string>>(UTF8.GetString(Properties.Resources.country));
code link: https://dotnetfiddle.net/o1Z3uv