R
Rob
Hi,
I have a small VB.Net program that reads in an HTML file using a
FileStream (this file was created by MS Word "Save as HTML" feature),
uses regular expressions to remove all unwanted code and then re-writes
the file.
It works fine but when I execute this on a french web page...the
StreamWriter removes all of the french characters. Here's a piece of the
code:
Dim filename As String = txtFilename.Text.ToString
Dim sr As StreamReader
sr = File.OpenText(filename)
Dim textstream As String = sr.ReadToEnd()
sr.Close()
Dim newtext As String
newtext = CleanHTML(textstream)
Dim fs As New FileStream(OutputFilename, FileMode.Create,
FileAccess.Write)
Dim sw As New StreamWriter(fs)
' I've also tried:
'Dim sw as New StreamWriter(fs, System.Text.Encoding.UTF8)
sw.WriteLine(newtext)
sw.Close()
I'm kinda new to .Net Development...does anyone see what's wrong here?
Thanks
I have a small VB.Net program that reads in an HTML file using a
FileStream (this file was created by MS Word "Save as HTML" feature),
uses regular expressions to remove all unwanted code and then re-writes
the file.
It works fine but when I execute this on a french web page...the
StreamWriter removes all of the french characters. Here's a piece of the
code:
Dim filename As String = txtFilename.Text.ToString
Dim sr As StreamReader
sr = File.OpenText(filename)
Dim textstream As String = sr.ReadToEnd()
sr.Close()
Dim newtext As String
newtext = CleanHTML(textstream)
Dim fs As New FileStream(OutputFilename, FileMode.Create,
FileAccess.Write)
Dim sw As New StreamWriter(fs)
' I've also tried:
'Dim sw as New StreamWriter(fs, System.Text.Encoding.UTF8)
sw.WriteLine(newtext)
sw.Close()
I'm kinda new to .Net Development...does anyone see what's wrong here?
Thanks