VB.NET 2010 again, trouble display letter "
Moskog
Posts: 556
Hi!
Trouble here with VB.NET 2010..
I try to read a txt file into an array and one of the words include the Norwegian letter
Trouble here with VB.NET 2010..
I try to read a txt file into an array and one of the words include the Norwegian letter

Comments
I can type an "
Can you write to a file, and check that ?
It may be reading fine, and just the viewing window has a different font, or handler.
Good point, I have no file-saving procedure yet but I can make one. But too late tonight, we will see tomorrow.
protected void WriteWithEncoding() { try { using (StreamReader sr = new StreamReader("TestFile.txt")) { var encoding = Encoding.GetEncoding("iso-8859-1"); byte[] bytes = new byte[sr.BaseStream.Length]; sr.BaseStream.Read(bytes, 0, (int)sr.BaseStream.Length); var line = encoding.GetString(bytes); textBox1.Text = line; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load RichTextBox1.Font = New Font("Arial", 18) Dim i As Integer For i = 32 To 255 RichTextBox1.Text += Chr(i) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click RichTextBox1.SaveFile("c:\new folder\demo.txt", RichTextBoxStreamType.PlainText) End Sub End ClassFirst I made a simple saving procedure by saving one word from a text box, including the special letter