StreamReader Problem?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a HTML file containing Hebrew and Arabic text when using following
code to read its content

string templateFile = Server.MapPath("MsgTemplate.htm");
System.IO.StreamReader reader = new System.IO.StreamReader(templateFile);
string fileHTML = reader.ReadToEnd();
reader.Close();

the retured string is only the HTML without the arabic or Hebrew text ,WHY?
(where the arabic and hebrew text are location is blank!!!!
 
System.IO.StreamReader reader = new System.IO.StreamReader(templateFile);

The constructor you're using here assumes that the text is stored as
UTF-8. If characters are disapearing it most likely uses some other
encoding. Make sure you specify the correct encoding as the second
parameter to the constructor.




Mattias
 
Back
Top