[Mono-dev] UTF-8 in Read Text Files

LB Audio Uchoa NET lbaudio at uchoanet.com.br
Thu May 3 05:26:29 EDT 2007


Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Botões.txt =

'Maçã, Melão, Fuscão, Mané,

'Works Windows and Linux more

'Return ERROR Ma, Melo, Fusco, Man,

Dim textFile As String = "Botões.txt"

Dim enc As System.Text.Encoding = System.Text.Encoding.GetEncoding("UTF-8")

Dim str As String = System.IO.File.ReadAllText(textFile, enc)

'Works in Windows no Works in Linux

'Return OK Maçã, Melão, Fuscão, Mané,

Dim AllText As String

Dim LineOfText As String

FileOpen(1, "Botões.txt", OpenMode.Input)

Do Until EOF(1)

LineOfText = LineInput(1)

AllText = AllText & LineOfText & ControlChars.CrLf

Loop

FileClose(1)

Text1.Text = AllText

End Sub

End Class

Thanks For Help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070503/10cb1ebb/attachment.html 


More information about the Mono-devel-list mailing list