除了html属性中包含的希腊字符外,所有其他内容都可以正常使用希腊字符。
Cereal :1.3.7
Config.groovy:
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
<title>Test title</title>
<meta name="keywords" content="ελληνικό τεστ"/>
</head>
<body>
Greek Test Encoding
</body>
</html>
<html>
<head>
<title>Test title</title>
<meta name="keywords" content="ελληνικό τεστ"/>
</head>
<body>
Greek Test Encoding
</body>
</html>
最佳答案
尝试设置Config.groovy的grails.views.default.codec ='html'以在应用程序中默认情况下获取HTML转义。
如果只想为页面设置默认编解码器:
<%@page defaultCodec="html" %>
https://stackoverflow.com/questions/9615337/