为什么变音符号和特殊字符在我的 Grails 页面中无法正确显示?

发布于 2024-07-07 03:58:06 字数 35 浏览 6 评论 0原文

如何确保 Grails 使用正确的编码 (UTF-8)?

How do I make sure the correct encoding (UTF-8) is used by Grails?

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

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

发布评论

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

评论(3

給妳壹絲溫柔 2024-07-14 03:58:06

比我想象的容易 - 只需确保您的编辑器设置为 UTF-8 编码即可。

Easier than I thought - simply make sure your editor is set to UTF-8 encoding.

锦上情书 2024-07-14 03:58:06

我发现有时将文件类型设置为 UTF-8 还不够。 有时你需要告诉AppServer。

<代码>
response.setContentType("text/html; charset=UTF-8");
request.setCharacterEncoding("UTF-8");

I've found that sometimes setting the file type to UTF-8 isn't enough. Sometimes you need to tell the AppServer.


response.setContentType("text/html; charset=UTF-8");
request.setCharacterEncoding("UTF-8");

拿命拼未来 2024-07-14 03:58:06

也许你不应该使用UTF-8。 也许您应该尝试 8859 ISO 字符集之一:http:// /www.global-translation-services.com/iso8859.html#ISO-8859-1

Maybe you shouldn't use UTF-8. Maybe you should try one of the 8859 ISO charsets:http://www.global-translation-services.com/iso8859.html#ISO-8859-1

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