Can't change html charset

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can't change html charset

İsmail Hakkı Ayaz
Hello,

In my Grails-Vue application I build my vue client with Webpack and create index.html under src/main/webapp. When I deploy the application to tomcat 8, index.html's content-type comes as :

Content-Type: text/html;charset=ISO-8859-1

My UrlMappings is like this:
class UrlMappings {

    static mappings = {
       "/api/$controller/$action?/$id?(.$format)?"{
        }
     
       "/"(uri: "/index.html")
    }
}

I have below configuration in my application.yml
grails:
    views:
        default:
            codec: html
        gsp:
            encoding: UTF-8
            htmlcodec: xml
            codecs:
                expression: html
                scriptlets: html
                taglib: none
                staticparts: none

I also created an Interceptor as the following :
class CharsetInterceptor {

    boolean before() {
        response.setCharacterEncoding("UTF-8")
        true }

    boolean after() { true }

    void afterView() {
        // no-op
    }
}

I changed URIEnconding to 'UTF-8' in tomcat's server.xml. Still my views are not coming UTF-8 encoded. What should I do in order to make my client UTF-8 encoded ?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/16ed9818-19ac-43e2-8e28-4dba011e563a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.