日期:2014-05-17  浏览次数:20428 次

word怎样转成utf-8编码的html文件?
做一个项目,需要将word文件导入后显示在kindeditor里面,其中一步是将word转成html,但找的例子都是生成gb2312编码的html,有没有能一步到位转成utf-8的方法?

------解决方案--------------------
似乎没有,他不是转成gb2312,而是转成系统默认的语言,你换个英文系统试试
------解决方案--------------------
你可以把gb2312在转换为utf-8

string gb2312info = "测试!";
string utfinfo = string.Empty;
Encoding utf8 = Encoding.UTF8;
Encoding gb2312 = Encoding.GetEncoding("gb2312");

// Convert the string into a byte[].
byte[] unicodeBytes = gb2312 .GetBytes(gb2312info );
// Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(gb2312,utf8,  unicodeBytes);