R
rhitam
Hi all,
I am trying to write a html to a word file. Basically i havea list of
html files and i need their content accumulated and put into one word
file .That is not the problem. The problem is handling special
characters. My code is something like this:
string Htmltext = somehtml;
WriteToFile("somefile.doc", Htmltext);
public static void WriteToFile(string strPath, ref string strData,
FileMode FM, FileAccess FA, FileShare FSHR)
{
FileStream FS = File.Open(strPath, FM, FA, FSHR);
byte[] b = Encoding.UTF8.GetBytes(strData);
FS.Write(b, 0, b.Length);
FS.Close();
}
Now there are characters like the trademark character (&trade
and
many others which are encoded with correct escape sequence in the
original file . When they are written into the word file, they show up
as junk chracters. But if i just open the existing html file in
word , then it shows correctly. Really need urgent help with this.
Thanks ,
Rhitam
I am trying to write a html to a word file. Basically i havea list of
html files and i need their content accumulated and put into one word
file .That is not the problem. The problem is handling special
characters. My code is something like this:
string Htmltext = somehtml;
WriteToFile("somefile.doc", Htmltext);
public static void WriteToFile(string strPath, ref string strData,
FileMode FM, FileAccess FA, FileShare FSHR)
{
FileStream FS = File.Open(strPath, FM, FA, FSHR);
byte[] b = Encoding.UTF8.GetBytes(strData);
FS.Write(b, 0, b.Length);
FS.Close();
}
Now there are characters like the trademark character (&trade
![Wink ;) ;)](/styles/default/custom/smilies/wink.gif)
many others which are encoded with correct escape sequence in the
original file . When they are written into the word file, they show up
as junk chracters. But if i just open the existing html file in
word , then it shows correctly. Really need urgent help with this.
Thanks ,
Rhitam