0

I have this text in txt file:

[
    {
        "book_name": "CYRILLIC LETTERS",
        "book_id": "Text",
    },
    {
        "book_name": "CYRILLIC LETTERS",
        "book_id": "Text",
    },
]

When I use StreamReader to read it, it is replacing the cyrillic letters with question marks. What should I do to be able read properly?

StreamReader readStream = new StreamReader("D:\\TEST.txt");
string text = readStream.ReadToEnd();

Thanks for the help!

Dilshod
  • 3,189
  • 3
  • 36
  • 67
  • 1
    If encoding is not UTF8 you need to specify it explicitly. – Alexei Levenkov Jan 21 '15 at 04:16
  • @AlexeiLevenkov Thanks for your response. It works. What is the difference between the text in txt file and response from web request? If it is web response it is replacing the cyrillic letters with num,bers like this: \u041c\u0410\u0422\u0422\u041e – Dilshod Jan 21 '15 at 04:22
  • Here are couple links that likley give you an answer (since it is not clear what you actually looking for and this is not actual SO question) : http://www.joelonsoftware.com/articles/Unicode.html , http://en.wikipedia.org/wiki/Unicode_and_HTML , https://msdn.microsoft.com/en-us/library/ie/2yfce773%28v=vs.94%29.aspx, http://stackoverflow.com/questions/9738282/replace-unicode-escape-sequences-in-a-string – Alexei Levenkov Jan 21 '15 at 15:23

0 Answers0