S Shiva Nov 5, 2004 #2 Use one of the StreamReader constrcutor overloads that accepts encoding parameter. The default is UTF-8. HTH. How to read ANSI text. The sream reader reads only UTF-8
Use one of the StreamReader constrcutor overloads that accepts encoding parameter. The default is UTF-8. HTH. How to read ANSI text. The sream reader reads only UTF-8
J Jay B. Harlow [MVP - Outlook] Nov 5, 2004 #3 Nikolay, Use the overloaded StreamReader constructor that accepts an encoding object. Something like: Imports System.IO Imports System.Text Dim reader As New StreamReader("myfile.txt", Encoding.Default) For output you could use: Dim writer As New StreamWriter("myfile.txt", False, Encoding.Default) Encoding.Default represents the ANSI code page that is set under Windows Control Panel. For a more specific ANSI code page you could use Encoding.GetEncoding. For information on Encodings, Unicode & such see: http://www.yoda.arachsys.com/csharp/unicode.html Hope this helps Jay
Nikolay, Use the overloaded StreamReader constructor that accepts an encoding object. Something like: Imports System.IO Imports System.Text Dim reader As New StreamReader("myfile.txt", Encoding.Default) For output you could use: Dim writer As New StreamWriter("myfile.txt", False, Encoding.Default) Encoding.Default represents the ANSI code page that is set under Windows Control Panel. For a more specific ANSI code page you could use Encoding.GetEncoding. For information on Encodings, Unicode & such see: http://www.yoda.arachsys.com/csharp/unicode.html Hope this helps Jay