[ 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
}
posted @ 2013-07-29 15:40  程序员文道  阅读(520)  评论(0编辑  收藏  举报