Instead of Cyrillic characters, I get \u4430\u0446 . Json.NET type libraries do not connect to my CRM system. So you need to somehow do this with standard decoders. How to decode using standard C # tools?

Here is a sample code:

 HttpWebRequest request = (HttpWebRequest)WebRequest.Create("url"); request.Method = "GET"; request.Accept = "application/json"; WebResponse resp = request.GetResponse(); Stream stream = resp.GetResponseStream(); StreamReader rdr = new StreamReader(stream); string str = rdr.ReadToEnd(); Console.WriteLine(str); 

Thanks for answers!

  • 2
    everything is fine, this is what they are, read the format , when decoding should become normal Russian - BOPOH

2 answers 2

 System.Text.RegularExpressions.Regex.Unescape("\u4430\u0446"); 

    You are doing wrong. JSON is a serialized format, you must deserialize it, and your strings will be correct. You should not be interested in how the strings look in serialized form.

    For example, you can use JSON.NET :

     public class Account { public string Name { get; set; } } string json = @"{ 'Name': '\u0412\u0430\u0441\u044f' }"; Account account = JsonConvert.DeserializeObject<Account>(json); Console.WriteLine(account.Name);