简体   繁体   中英

Grails encoding problem with GSP

I'm having trouble with groovy server pages (gsp) where utf-8 chars are not showing propertly, and instead displaying as "?". This occurs inside grails tags like "${}".

Example:

<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

The gsp already are in UTF-8. My grails version is 1.2 M3 and in localhost the chars are showing ok, but in server (tomcat) they are not.

Thinking that was version problem, I upgraded to 1.3.3 and the problem still happens, but now on localhost too.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM