我正在编写一个程序来从 Html 文件中获取数据,但我的问题是在波斯语中接收到的字符写得不好。
在其他语言中:
某些字符因不编码而被称为邪恶
例如,���� ������� ������
我的代码是:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
Dim pfile As String
pfile = OpenFileDialog1.FileName.ToString
Dim a As System.Text.Encoding
a = System.Text.Encoding.UTF8 '' I used other encoding Such as default assci windows-1257 and ... but not fix!!
Dim k_reader As New StreamReader(pfile.ToString, a)
RichTextBox1.Text = k_reader.ReadToEnd
End Sub
End Class