简体   繁体   English

使用python win32com软件包时如何控制html的编码?

[英]How to control the encoding of html when using python win32com package?

In python, I use win32com to transform word documents to HTML: 在python中,我使用win32com将Word文档转换为HTML:

from win32com import client as wc 
import os 

word = wc.Dispatch('Word.Application')
doc = word.Documents.Open(wordFullName)
doc.SaveAs(htmlFullName, 10)

But the resulting encoding of the HTML is gb2312: 但是HTML的最终编码为gb2312:

<meta http-equiv=Content-Type  content="text/html; charset=gb2312" >

How do you control the encoding option of the resulting HTML? 如何控制结果HTML的编码选项?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM