I have a very simple question, which I seem to be unable to omit.
I encoded UTF8-String correctly, I am in JObject with Json.NET, I script with some values and write it to the command line, keeping the encoded characters intact.
Everything works fine, except for keeping the encoded characters intact.
the code:
var json = "{roster: [[\"Tulg\u00f4r\", 990, 1055]]}";
var j = JObject.Parse(json);
for (int i = 0; i < j["roster"].Count(); i++)
{
j["roster"][i][1] = ((int)j["roster"][i][1]) * 3;
j["roster"][i][2] = ((int)j["roster"][i][2]) * 3;
}
Console.WriteLine(JsonConvert.SerializeObject(j, Formatting.None));
Actual output:
{"roster":[["Tulgôr",2970,3165]]}
Output Required:
{"roster":[["Tulg\u00f4r",2970,3165]]}
It seems that my phrasing in Google is inappropriate, since nothing useful has come. I'm sure this is something uber-easy, and after that I will feel stupid. :)
source
share