Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stream can't read Thai Font

0 views
Skip to first unread message

Anan Ananthasri

unread,
Jan 19, 2003, 7:58:15 AM1/19/03
to
I try to test the following code

string sURL;
sURL = "http://www.kaveethai.com";

WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sURL);

Stream objStream;
objStream = wrGETURL.GetResponse
().GetResponseStream();
StreamReader objReader = new
StreamReader(objStream);

string sLine = objReader.ReadToEnd
();

MailMessage myMail = new
MailMessage();
myMail.From = "Ananthasri
<an...@wethai.com>";
myMail.To = "Ananthasri
<an...@wethai.com>";
myMail.Subject
= "UtilMailMessage001";
myMail.Priority = MailPriority.Low;
myMail.BodyFormat =
MailFormat.Html;
myMail.Body = sLine;
SmtpMail.Send(myMail);

This web site have THAI character.

but when I retrieve the HTML code, the Thai character it
change to "?" and I can't read it.

How to I fix this problem?
Thank..
Anan Ananthasri
Thailand

Chris A R

unread,
Jan 19, 2003, 9:39:52 AM1/19/03
to
Encoding encode = Encoding.GetEncoding( 874 );// 874 for Thai

StreamReader objReader = new
StreamReader(objStream, encode);

Hope this helps,
Chris A. R.

"Anan Ananthasri" <anant...@hotmail.com> wrote in message
news:014601c2bfba$6e81ae50$8df82ecf@TK2MSFTNGXA02...

0 new messages