0

From request http://ua-zip.net/script/suggest.php?prefix=61105&type=index I receive an answer like this:

"\"1 \u0410\u0441\u043a\u043e\u043b\u044c\u0434\u0456\u0432\u0441\u044c\u043a\u0438\u0439".

For request I'm using:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(FullRequestString);
    request.Method = "GET";

I receive response by the construction:

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (Stream stream = response.GetResponseStream())
 {
  using (StreamReader reader = new StreamReader(stream))
   {
   string line = "";
   while ((line = reader.ReadLine()) != null)
    {

How can I transform the character like \u043b into cyrillic symbol

1 Answers1

0

You would have to use HTML. Try replacing all the \u with &#x like \u0410 will become А. Dont forget the semicolon at the end. then just do this.

string cyrillicString = System.Net.WebUtility.HtmlDecode(your_string_with_replaced_characters);

The resulting string will contain cyrillic characters

Note : &#x is used if the numbers are Hexadecimal. For decimal just use &#.

Suraj S
  • 1,019
  • 7
  • 18