[Geoserver-devel] Character encoding problems

Hi everybody,
currently we have many jira opened (I have done a quick inventory and found GEOS-6073, GEOS-6079, GEOS-6083, GEOS-6089).

In particular I was trying to solve GEOS-6079 and didn’t find any reasonable way to do it.
The problem seems to be that on some platforms, even if anything I can think of is configured to use UTF-8, StyleEditPage is submitting the style contained in its textarea using ISO-8859-1. The server code is not able to recognize that, so it simply uses the text as it was UTF-8 and scrambles it when it contains non ASCII characters.
Long story short, what I was thinking to do is to use some kind of character encoding detector to accept anything is coming from the form submission and convert it to UTF-8 properly. I did some tests with cpdetector (http://cpdetector.sourceforge.net/index.shtml) that I also used in the past for other projects and it seems to work.
What do you think if we add this kind of detection to failing pieces of code (like in StyleEditPage)?

We would need to add some more jars to the build (about 500K in total, of wich 430K is antlr2 and the remaining part the detector).

In alternative we should try to understand why the incoming SLD encoding is not correct, but I havent’t figured it out yet.

Regards,
Mauro

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it