[Geoserver-users] GetFeatureInfo characterset missing

Hi All,

I am migrating data from Geoserver 1.7.2 to 2.3.0. When I connect a specific WMS layer from Geoserver 1.7.2 to Geonetwork, the map viewer renders getFeatureInfo response properly. When I connect the same layer from Geoserver 2.3.0 Geonetwork map viewer fails to show UTF-8 characters.
The reason is probably the HTTP Content-Type in the response header.

Geoserver 1.7.2:
Content-Type: text/plain;charset=UTF-8

Geoserver 2.3.0:
Content-Type: text/plain

Having no charset attribute the client misinterprets encoding.
Is there any way to let the client know that the response from Geoserver 2.3.0 is a UTF-8 text?

Best regards,
Laszlo S.

Hi All,

I am migrating data from Geoserver 1.7.2 to 2.3.0. When I connect a
specific WMS layer from Geoserver 1.7.2 to Geonetwork, the map viewer
displays getFeatureInfo response properly. When I connect the same layer
from Geoserver 2.3.0 Geonetwork map viewer fails to show UTF-8
characters. The reason is probably the HTTP Content-Type in the response header.

Geoserver 1.7.2 sends:
Content-Type: text/plain;charset=UTF-8

Geoserver 2.3.0 sends:
Content-Type: text/plain

Having no charset declared the Geonetwork client misinterprets the encoding and messes up the output.
Is there any way to make Geoserver 2.3.0 send a complete HTTP header, so the client knows that it recieves a UTM-8 text?

Best regards,
Laszlo S.

On Fri, Apr 19, 2013 at 8:28 AM, sores <sores@anonymised.com> wrote:

Hi All,

I am migrating data from Geoserver 1.7.2 to 2.3.0. When I connect a
specific WMS layer from Geoserver 1.7.2 to Geonetwork, the map viewer
displays getFeatureInfo response properly. When I connect the same
layer
from Geoserver 2.3.0 Geonetwork map viewer fails to show UTF-8
characters. The reason is probably the HTTP Content-Type in the
response header.

Geoserver 1.7.2 sends:
Content-Type: text/plain;charset=UTF-8

Geoserver 2.3.0 sends:
Content-Type: text/plain

Having no charset declared the Geonetwork client misinterprets the
encoding and messes up the output.
Is there any way to make Geoserver 2.3.0 send a complete HTTP header,
so the client knows that it recieves a UTM-8 text?

First off, you posted the same message multiple times on multiple mailing
lists.
Please avoid that in the future, and read the posting guidelines here:
http://geoserver.org/display/GEOS/GeoServer+user+list+posting+guidelines

About the charset, I'm not sure. Don't think there is any code in geoserver
that
sets the charset in the returned content types, however I've noticed in the
past that Jetty has a tendency to add that bit, while for example Tomcat
does not.

The issue you're talking about looks to me more of a problem with GeoNetwork
own code, OGC makes no requirement to add the charsets in the content types,
at least, that I know of.

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

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

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

-------------------------------------------------------

Hi Andrea,

Thanks for the response!

In both cases I use Tomcat. I have checked the response with wfetch, and Geoserver 1.7.2 behavior is different from Geoserver 2.3.0. The problem only occurres when GetFeatureInfo format is text/plain, otherwise charset is defined in the html or xml header. Unfortunately, Geonetwork seem to use text/plain. However, the root of the problem is the ambiguous output of Geoserver.

If there is no way to make Geonetwork assume that the undefined charset is UTF-8, is there any workaround for the problem in Geoserver or tomcat?

Best regards,

Laszlo

wfetch.png

···

Hi All,

I am migrating data from Geoserver 1.7.2 to 2.3.0. When I connect a
specific WMS layer from Geoserver 1.7.2 to Geonetwork, the map viewer
displays getFeatureInfo response properly. When I connect the same
layer
from Geoserver 2.3.0 Geonetwork map viewer fails to show UTF-8
characters. The reason is probably the HTTP Content-Type in the
response header.

Geoserver 1.7.2 sends:
Content-Type: text/plain;charset=UTF-8

Geoserver 2.3.0 sends:
Content-Type: text/plain

Having no charset declared the Geonetwork client misinterprets the
encoding and messes up the output.
Is there any way to make Geoserver 2.3.0 send a complete HTTP header,
so the client knows that it recieves a UTM-8 text?

First off, you posted the same message multiple times on multiple mailing lists.
Please avoid that in the future, and read the posting guidelines here:
http://geoserver.org/display/GEOS/GeoServer+user+list+posting+guidelines
About the charset, I’m not sure. Don’t think there is any code in geoserver that
sets the charset in the returned content types, however I’ve noticed in the
past that Jetty has a tendency to add that bit, while for example Tomcat does not.
The issue you’re talking about looks to me more of a problem with GeoNetwork
own code, OGC makes no requirement to add the charsets in the content types,
at least, that I know of.
Cheers
Andrea

==
GeoServer training in Milan, 6th & 7th June 2013! Visit http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it

On Tue, Apr 23, 2013 at 10:47 AM, sores <sores@anonymised.com> wrote:

**

Hi Andrea,

Thanks for the response!

In both cases I use Tomcat. I have checked the response with wfetch, and
Geoserver 1.7.2 behavior is different from Geoserver 2.3.0. The problem
only occurres when GetFeatureInfo format is text/plain, otherwise charset
is defined in the html or xml header. Unfortunately, Geonetwork seem to use
text/plain. However, the root of the problem is the ambiguous output of
Geoserver.

If there is no way to make Geonetwork assume that the undefined charset is
UTF-8, is there any workaround for the problem in Geoserver or tomcat?

Not that I know of. As said before, I have a hard time considering this a
bug too, I don't remember OGC demanding the charset to be added to the
mime types.

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

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

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

-------------------------------------------------------