On Apr 4, 6:33*am, "Samuel" <samuel.shul...@ntlworld.comwrote:
Hi
Currently text file that I create are UTF-8 encoded and I need ANSI encoding
how can I do that
Thank you,
Samuel
IIRC System.Text.Encoding.Default maps to ANSI
///////////////////
Option Strict On
Imports System.IO
Imports System.Text
Module Module1
Sub Main()
Dim text As String = "hello, world"
Using stream As New
FileStream(Environment.GetFolderPath(Environment.S pecialFolder.Desktop)
& "/file.txt", FileMode.Create)
Dim bytes As Byte() = Encoding.Default.GetBytes(text)
stream.Write(bytes, 0, bytes.Length)
End Using
End Sub
End Module
/////////////
Thanks,
Seth Rowe [MVP]