i18n特殊字符未正确显示在胸腺电子邮件模板中

发布于 2025-01-20 13:53:45 字数 564 浏览 3 评论 0原文

我正在使用i18n在Java Springboot应用程序中翻译电子邮件,将胸腺作为模板。当我从葡萄牙语中写特殊字符,收到电子邮件时(通过Outlook Web/App和Windows的邮件应用程序)时,就会发生问题:

descri.o
Para Maiores Informa.es clique aqui。

当我尝试显示此文本时:

Para MaioresInformações,集团Aqui

descrição

我已经尝试了< meta http-equiv =“ content-type” content =“ text/html; charset = utf-8”/>,我也尝试添加html special像这样替换葡萄牙语中的C和A的字符:descri& ccedil& atildeo 仍然不起作用。我已经完成了研究,但我仍然找不到为什么这些特殊角色无法正确显示。

I'm using i18n to translate emails in my Java SpringBoot Application, using thymeleaf as its templates. The problem occurs when i write special characters from portuguese language, when i receive the email (via Outlook web/app, and the Mail app from windows) it displays like this:

Descri��o
Para maiores informa��es clique aqui.

When I'm trying to display this text:

Para maiores informações, clique aqui

Descrição

I've tried with <meta http-equiv="content-type" content="text/html;charset=utf-8" />, I've also tried adding HTML special characters to replace the C and A in portuguese like so: descriÇÃo and it still doesnt work. I've done my research but I still cant find why these special characters wont display correctly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凹づ凸ル 2025-01-27 13:53:45

在 IDE 中检查 thymeleaf 模板文件 (.html) 的编码。这也应该是 UTF-8。在某些情况下(例如 messages.properties),默认值为 ISO-8859-1

check the encoding of your thymeleaf template file (<your_template>.html) in your IDE. this should also be UTF-8. In some cases (like e.g. messages.properties) the default is ISO-8859-1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文