i18n特殊字符未正确显示在胸腺电子邮件模板中
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 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