0

I'm using IO.File.ReadAllLines(FileName) to read all lines from text file to array of strings at once. Problem is, text lines include ANSI characters above ASCII value 127 (Scandinavian letters e.g. "Ä" (Ascii 196), "ö" (Ascii 246) and "é" (Ascii 233). Array is build up nicely, but all chars above ascii value 127 are not shown right. How can I use ANSI character set with .ReadAllLines to correct this problem? In VB6 with "Open Filename For Input As #1 / Line Input #1, txtLine" there wasn't any problem.
Any suggestions? Thank's.

2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by thines01
0

Try UTF8 or some of the other encodings:

Dim arr_strData As String() =
         File.ReadAllLines("..\..\AnsiFile.txt", System.Text.Encoding.UTF8)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.