[ C# ] 字符串任意编码输出

static void Main(string[] args)
{
    StreamReader m_StreamReader = new StreamReader(" your input file path ");
    string str = m_StreamReader.ReadToEnd();
    File.WriteAllText(" your output file path", str, Encoding.GetEncoding("utf-16"));// the encoding you want
}

作者:文道
出处:http://www.cnblogs.com/VincentDao
关于作者:北漂猴子一枚
本文版权归作者文道所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接
如有问题,可以通过邮件my_interface@126.com联系我,非常感谢。

原文地址:https://www.cnblogs.com/VincentDao/p/3223064.html