日文的编码是Shift-JIS,而C#默认是unicode,因此如果不转换的话,日文显示乱码。
因此,在C#中处理日文必须转换编码。代码如下:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1 string fileName = @"E:\Swimmers20090121.txt";
2 StreamReader sr = new StreamReader(fileName,System.Text.Encoding.GetEncoding("Shift-JIS"));
3 string sLine = sr.ReadLine();
4