GSP 的 Grails 编码问题
我在使用 groovy 服务器页面(gsp)时遇到问题,其中 utf-8 字符未正确显示,而是显示为“?”。这发生在像“${}”这样的grails 标签内。
示例:
<p>Não</p> --> output browser: Não - OK
<g:link title="Avaliação Relatório"....> output browser: Avaliaç?o Relat?rio
${value? "Sim" : "Não"} output browser: N?o
gsp 已采用 UTF-8 格式。我的 grails 版本是 1.2 M3,在 localhost 中字符显示正常,但在服务器(tomcat)中则不然。
认为这是版本问题,我升级到1.3.3,问题仍然发生,但现在也在本地主机上。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有给你一个明确的解决方案,但我怀疑你应该看看 此处。我遇到了瑞典字符未在 ${} 中显示的问题,但那是因为我设置了...
grails.views.default.codec = 'html'
...这在我的 Javascript 中不起作用。该配置或...
grails.views.gsp.encoding
...可能会给您提供所需的线索。希望你能找到它!
I don't have a definitive solution for you, but I'm suspecting you should have a look here. I had problems with Swedish characters not showing in ${}, but that was because I had set...
grails.views.default.codec = 'html'
...which didn't work in my Javascript. That config or...
grails.views.gsp.encoding
...might give you the clue you need. Hope you find it!