OpenXML 将单词保存为 txt,编码为 UTF8
我想将doc文件转换为txt文件,但是丢失了一些字符,请参见以下代码:
object format = WdSaveFormat.wdFormatText;
doc.SaveAs(ref outputFilePath, ref format,
ref ObjectConstants.False, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown);
我的问题是如何将txt的编码设置为UTF8?
I want to convert a doc file to txt file, but some characters are lost, see the following code:
object format = WdSaveFormat.wdFormatText;
doc.SaveAs(ref outputFilePath, ref format,
ref ObjectConstants.False, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown,
ref Unknown, ref Unknown);
My question is how to set the encoding of txt to UTF8?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.saveas%28office.11%29.aspx
Check Encoding param in http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.saveas%28office.11%29.aspx