0.10.1-SNAPSHOT Encoding problem

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

0.10.1-SNAPSHOT Encoding problem

jay.cz
Hi,

I have came across another issue, which is now connected to snapshot version of 0.10.1. Fonts & Favicons work fine after getting this version. However my site now has problem with displaying special international characters (namely czech characters like čřěů). There are ? instead of them

They work fine in "older" 0.10.0 :)

I have also tried to enable UTF-8 encoding filter in my web.xml but it did not help.
<filter>
                <filter-name>CharacterEncodingFilter</filter-name>
                <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
                <init-param>
                    <param-name>encoding</param-name>
                    <param-value>UTF-8</param-value>
                </init-param>
                <init-param>
                    <param-name>forceEncoding</param-name>
                    <param-value>true</param-value>
                </init-param>
          </filter> 
    <filter-mapping>
             <filter-name>CharacterEncodingFilter</filter-name>
             <url-pattern>/*</url-pattern>
</filter-mapping>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

Thibault Duchateau
Administrator
Hi,

First of all, you must ensure to declare the CharacterEncodingFilter at first in your web.xml file.
Then, the error may come from here: https://github.com/dandelion/dandelion/blob/wip/0.10.1/dandelion-core/src/main/java/com/github/dandelion/core/web/DandelionFilter.java#L151.

I should replace this line with:
String html = new String(bytes, "UTF-8");

And I'll probably add a configuration point here.

Since I'm currently unable to provide a testing version, the only way for you is to build the dandelion-core JAR by yourself and test it. Or please wait until next week when I'm back from holidays ;-)

Regards,
Thibault
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

jay.cz
Thanks! Enjoy your holidays.

By the way - I tried to put endonding filter before dandelion filter in web.xml, unfortunatelly it did not help.

I will try to build it with with the change you described and let you know the result.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

jay.cz
Hi again,

it took me some time to get back to problem. I have changed the line you mentioned and set encoding to UTF-8. The result is actually even worse than before :/

------------
With the code: String html = new String(bytes);
Only characters with this small hook ˇ are replace by question marks:  č -> ?


---------
With new setting String html = new String(bytes, "UTF-8");

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

Thibault Duchateau
Administrator
Hi,

Sorry, I didn't have time to investigate more but it's in my toto list :-)

Regards,
Thibault.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

jay.cz
Thanks! No need to hurry. I have just got back to 0.9.3 version, which works fine. As soon as you will have new release I will test it and let you know about the result.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

grodriguezpiriz
I had the same problem and it was driving me crazy, because (in case it might help) on an eclipse-embedded Tomcat under Windows it worked fine, but when I deployed the WAR file to a tomcat hosted on a Linux machine it didn't and all my pages were full of "?" characters.

So, I got back to 0.10.0 and it worked :)

(Spent three hours on it until I found this thread... thanks jay.cz!!)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 0.10.1-SNAPSHOT Encoding problem

Thibault Duchateau
Administrator
Hi,

It would be awesome if you could give a try to the latest 0.11.0-SNAPSHOT.
I'd love to see these encoding issues solved once and for all.

Let me know if you need help.

Regards,
Thibault.
Loading...