I would use UTF8 encoding.
This example outputs readable character only in UTF8.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim sw As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\temp\test.txt", False,
System.Text.Encoding.ASCII)
sw.WriteLine("-------------------")
sw.WriteLine("ASCII")
sw.WriteLine("Ligne 2: éàèêô.")
sw.WriteLine("-------------------")
sw.Close()
sw = New System.IO.StreamWriter("c:\temp\test.txt", True,
System.Text.Encoding.UTF8)
sw.WriteLine("-------------------")
sw.WriteLine("UTF8")
sw.WriteLine("Ligne 2: éàèêô.")
sw.WriteLine("-------------------")
sw.Close()
End Sub
--
HTH
Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
S2i web inc. (
www.s2i.com)
http://www.emoreau.com/
"WH" <wi**********@skynet.bewrote in message
news:45**********************@news.skynet.be...
Hi,
I use a Streamreader in VB2005 to read text files I made before in
NotePad, but it can't read characters like "é" or "ç". They are omitted,
or replaced by other characters. I tried different encodings, but I can't
fix the problem. In VB6 everything works well. I live in Belgium (Duch
language).
Can anyone help me?
Thanks,
WH