美文网首页
使用html-docx-js-typescript将富文本导出为

使用html-docx-js-typescript将富文本导出为

作者: 时光已翩然轻擦 | 来源:发表于2024-04-28 17:29 被阅读0次

一、问题

  • 当使用html-docx-js-typescript将富文本导出为word文档时,其中的中文内容以及一些中文标点符号会显示为乱码。

二、解决方法

  • 为html代码加上<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">,即:
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
     // 富文本的内容
  </body>
</html>

三、参考资料

四、相关内容

相关文章

网友评论

      本文标题:使用html-docx-js-typescript将富文本导出为

      本文链接:https://www.haomeiwen.com/subject/lbgzxjtx.html