GemBox Word 文档到电子邮件,£ 字符转换为问号

GemBox Word Document to Email ,£ character is converted to question mark

提问人:Bilal lilla 提问时间:11/17/2023 最后编辑:Bilal lilla 更新时间:11/22/2023 访问量:23

问:

GemBox Word 文档到电子邮件,为我的一个客户将 £ 字符转换为问号。

我的代码与gembox网站上的代码相同。

GemBox.Document.ComponentInfo.SetLicense(this.GemBoxDocumentLisense);
 GemBox.Email.ComponentInfo.SetLicense(this.GemBoxEmailLisense);

 var document = DocumentModel.Load(documentPath);
 using (MemoryStream gemBoxOutput = new MemoryStream())
 {
document.Save(gemBoxOutput , new GemBox.Document.HtmlSaveOptions()
{
    HtmlType = GemBox.Document.HtmlType.Mhtml,
    UseContentIdHeaders = true,
  //Encoding = Encoding = Encoding.UTF8
});
MailMessage.Load(gemBoxOutput, MailMessageFormat.Mhtml);
我想在不破坏模板的情况下使用 gembox 设置 utf-8 编码。我试图在htmlsaveoptions中设置编码,但它破坏了模板,并且电子邮件未在Outlook中正确加载。
字符编码 文档 gembox-email

评论

0赞 Mario Z 11/20/2023
是否可以共享“documentPath”路径中的文件?也许你有一个用“Windows-1252”编码编写的TXT文件。这可能会导致此问题,因为默认情况下 TxtLoadOptions 将使用 UTF8 编码。
0赞 Bilal lilla 11/22/2023
这基本上是.docx文件
0赞 Mario Z 11/22/2023
然后我不确定你有什么问题,DOCX 文件是用 UTF8 编码编写的。此外,HtmlSaveOptions 中的默认编码是 UTF8。
0赞 Bilal lilla 11/22/2023
这个问题只存在于我客户的一个服务器上,当您收到电子邮件时,它会将池塘符号转换为菱形问号。任何建议。
0赞 Bilal lilla 11/22/2023
@MarioZ 我想在不破坏模板的情况下使用 gembox 设置 utf-8 编码。我试图在htmlsaveoptions中设置编码,但它破坏了模板,并且电子邮件未在Outlook中正确加载。

答: 暂无答案