StreamWriter输出中文乱码的问题
将一般的:
outFile = new StreamWriter ("c:\\abc.txt",false);
改成
outFile = new StreamWriter ("c:\\abc.txt",false,Encoding.GetEncoding("gb2312"));
outFile.WriteLine("中文");
输出中文就没问题了;
outFile = new StreamWriter ("c:\\abc.txt",false);
改成
outFile = new StreamWriter ("c:\\abc.txt",false,Encoding.GetEncoding("gb2312"));
outFile.WriteLine("中文");
输出中文就没问题了;