[英]c# read hebrew from text file
I wrote a text file in the Hebrew language . 我用希伯来语写了一个文本文件。 When I present the contents of the file in C # I do not see what I wrote - I understand that it is tied to Unicode , but I do not really understand it .
当我用C#呈现文件的内容时,看不到我写的内容-我知道它与Unicode有关,但是我并不真正了解它。 Help , anyone?
帮助,有人吗?
string mymail = File.ReadAllText(@"C:\mail\mail.txt");
MessageBox.Show(mymail);
This is the result : 结果是:
You are missing your encoding, its probably defaulting to ASCII. 您缺少编码,它可能默认为ASCII。
string mymail = File.ReadAllText(@"C:\\mail\\mail.txt", System.Text.Encoding.UTF8);
MessageBox.Show(mymail);
string mymail = File.ReadAllText(@"C:\mail\mail.txt", System.Text.Encoding.GetEncoding("windows-1255"));
MessageBox.Show(mymail);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.