openshift-s2i / s2i-wildfly

Source-to-Image template for WildFly applications
http://wildfly.org/
Other
73 stars 145 forks source link

UTF-8 still not working #147

Closed speedfl closed 7 years ago

speedfl commented 7 years ago

Hello,

I am still facing the issue with UTF-8. In local it is working

So I added at the root of my git repository a directory cfg which contains:

standalone.xml with:

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" url-charset="UTF-8"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true" url-charset="UTF-8"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                </host>
            </server>
            <servlet-container default-encoding="UTF-8" name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
            </handlers>
            <filters>
                <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
            </filters>
        </subsystem>

then in my domain.xml everywhere I jave undertown I specified utf8:

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
                <buffer-cache name="default"/>
                <server name="default-server">
                    <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" url-charset="UTF-8"/>
                    <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true" url-charset="UTF-8"/>
                    <host name="default-host" alias="localhost">
                        <filter-ref name="server-header"/>
                        <filter-ref name="x-powered-by-header"/>
                    </host>
                </server>
                <servlet-container default-encoding="UTF-8" name="default">
                    <jsp-config/>
                    <websockets/>
                </servlet-container>
                <filters>
                    <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
                    <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
                </filters>
            </subsystem>

But I still get the non encoded character with : "?"

After some search on internet I found this:

https://github.com/jboss-dockerfiles/wildfly/issues/29

Maybe it is related?

I saw as well this: https://oncletom.io/2015/docker-encoding/

I will try tomorow and let you know

Regards

speedfl commented 7 years ago

I saw as well https://stackoverflow.com/a/28406007/6103690 It seems that issue is more linked to the fact that docker don't set the local. So I will fork the repo and check

speedfl commented 7 years ago

Solved it by adding parameter to the VM.

MAVEN_OPTS=-Dfile.encoding=UTF-8

bparees commented 7 years ago

thanks @speedfl (And for your readme update)