I am getting the following error (in IE), when sending a GetFeatureInfo request to GeoServer (1.5.1) through MapBuilder (1.5-alpha1).
Parsing Error:-10728296760 XML Parsing Error: An invalid character was found in text content.
This is due to the fact that the requested shape file contains a text field with danish characters.
This is more than IE can handle.
In Firefox I don´t get this error message, but the characters are not translated correctly here either.
Does anyone know how I handle the encoding correctly?
–
Best regards
Thomas Rokkjaer
Hi Thomas,
You have stumbled upon a known issue I believe with doing shapefile I/O
with extended character sets.
Chris:I seem to remember a thread on the geotools list about a patch for
this issue. Has the patch been applied, is there a jira around?
-Justin
Thomas Rokkjær wrote:
I am getting the following error (in IE), when sending a GetFeatureInfo
request to GeoServer (1.5.1) through MapBuilder (1.5-alpha1).
Parsing Error:-10728296760 XML Parsing Error: An invalid character was
found in text content.
This is due to the fact that the requested shape file contains a text
field with danish characters.
This is more than IE can handle.
In Firefox I don´t get this error message, but the characters are not
translated correctly here either.
Does anyone know how I handle the encoding correctly?
--
Best regards
Thomas Rokkjaer
!DSPAM:4007,468019b1214891961014482!
------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
!DSPAM:4007,468019b1214891961014482!
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4007,468019b1214891961014482!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
No, it's not been applied. It's annoying to apply since there are two shapefile datastores (indexed and non-indexed), and it'd need to be done on multiple branches. I put comments on: http://jira.codehaus.org/browse/GEOT-1210
The code works on 2.0.x, it's three classes that change - the datastore factory, the datastore, and the dbf reader. I'd imagine that's so far out of date that a patch wouldn't apply right.
Chris
Justin Deoliveira wrote:
Hi Thomas,
You have stumbled upon a known issue I believe with doing shapefile I/O
with extended character sets.
Chris:I seem to remember a thread on the geotools list about a patch for
this issue. Has the patch been applied, is there a jira around?
-Justin
Thomas Rokkjær wrote:
I am getting the following error (in IE), when sending a GetFeatureInfo
request to GeoServer (1.5.1) through MapBuilder (1.5-alpha1).
Parsing Error:-10728296760 XML Parsing Error: An invalid character was
found in text content.
This is due to the fact that the requested shape file contains a text
field with danish characters.
This is more than IE can handle.
In Firefox I don´t get this error message, but the characters are not
translated correctly here either.
Does anyone know how I handle the encoding correctly?
--
Best regards
Thomas Rokkjaer
------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
!DSPAM:4007,468019b1214891961014482!
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4007,468019b1214891961014482!
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
Chris Holmes ha scritto:
No, it's not been applied. It's annoying to apply since there are two shapefile datastores (indexed and non-indexed), and it'd need to be done on multiple branches. I put comments on: http://jira.codehaus.org/browse/GEOT-1210
The code works on 2.0.x, it's three classes that change - the datastore factory, the datastore, and the dbf reader. I'd imagine that's so far out of date that a patch wouldn't apply right.
Thomas, can you share the failing shapefile so that we can derive a
test case out of it? (Which means we'll have to grab a couple of records
from it and store the resulting shapefile among the Geotools sources?).
Cheers
Andrea
Yes. I made a really simple one, which consists of four records, where one of them uses a danish letter.
Best regards
Thomas Rokkjaer
On 6/26/07, Andrea Aime <aaime@anonymised.com> wrote:
Chris Holmes ha scritto:
No, it’s not been applied. It’s annoying to apply since there are two
shapefile datastores (indexed and non-indexed), and it’d need to be done
on multiple branches. I put comments on:
http://jira.codehaus.org/browse/GEOT-1210
The code works on 2.0.x, it’s three classes that change - the datastore
factory, the datastore, and the dbf reader. I’d imagine that’s so far
out of date that a patch wouldn’t apply right.
Thomas, can you share the failing shapefile so that we can derive a
test case out of it? (Which means we’ll have to grab a couple of records
from it and store the resulting shapefile among the Geotools sources?).
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
test_point.dbf (194 Bytes)
test_point.prj (395 Bytes)
test_point.shp (212 Bytes)
test_point.shx (132 Bytes)
Thomas Rokkjær ha scritto:
Yes. I made a really simple one, which consists of four records, where one of them uses a danish letter.
Good, I attached it to http://jira.codehaus.org/browse/GEOT-1210.
I'll fix this in the next days, stay tuned (you can watch the issue
to be notified of changes on it, and then grab a Geoserver nightly
to test it).
Cheers
Andrea
Actually I now believe it is more a problem with MapBuilder than GeoServer.
I tried adding the layer on a MapServer and access this layer through the same MapBuilder solution instead of the one from the GeoServer. Still the same error is presented in IE, eventhough I tried setting the request and response encoding as both UTF-8 and ISO-8859-1.
I haven´t put this information in the GeoTools JIRA.
Best regards
Thomas Rokkjaer
On 6/26/07, Andrea Aime <aaime@anonymised.com> wrote:
Thomas Rokkjær ha scritto:
Yes. I made a really simple one, which consists of four records, where
one of them uses a danish letter.
Good, I attached it to http://jira.codehaus.org/browse/GEOT-1210.
I’ll fix this in the next days, stay tuned (you can watch the issue
to be notified of changes on it, and then grab a Geoserver nightly
to test it).
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjær ha scritto:
Actually I now believe it is more a problem with MapBuilder than GeoServer.
I tried adding the layer on a MapServer and access this layer through the same MapBuilder solution instead of the one from the GeoServer. Still the same error is presented in IE, eventhough I tried setting the request and response encoding as both UTF-8 and ISO-8859-1.
Hum... or maybe MapServer too has troubles serving files in UTF8?
Cheers
Andrea
I agree. Especially after testing both WMS/WFS servers through another GIS client (MapInfo), where I found there were problems translating the danish characters too.
/Thomas
On 6/26/07, Andrea Aime <aaime@anonymised.com> wrote:
Thomas Rokkjær ha scritto:
Actually I now believe it is more a problem with MapBuilder than GeoServer.
I tried adding the layer on a MapServer and access this layer through
the same MapBuilder solution instead of the one from the GeoServer.
Still the same error is presented in IE, eventhough I tried setting the
request and response encoding as both UTF-8 and ISO-8859-1.
Hum… or maybe MapServer too has troubles serving files in UTF8?
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjær ha scritto:
Yes. I made a really simple one, which consists of four records, where one of them uses a danish letter.
Thomas, is the danish letter an o with a stroke over it?
That is, the is the string "Charløtte"? (not sure the string will
get to you intact). If so, the shapefile reader is grabbing it fine,
the issue must be somewhere else.
Cheers
Andrea
Yes that is how it should look. So where do you think the problem is originating from?
I know that the encoding “ISO-8859-1” can handle danish characters, while the encoding “UTF-8” can´t. Is all information sent and received using UTF-8 and if so, could this be an option in GeoServer?
Best regards
Thomas Rokkjaer
On 6/27/07, Andrea Aime <aaime@anonymised.com> wrote:
Thomas Rokkjær ha scritto:
Yes. I made a really simple one, which consists of four records, where
one of them uses a danish letter.
Thomas, is the danish letter an o with a stroke over it?
That is, the is the string “Charløtte”? (not sure the string will
get to you intact). If so, the shapefile reader is grabbing it fine,
the issue must be somewhere else.
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjær ha scritto:
Yes that is how it should look. So where do you think the problem is originating from?
I know that the encoding "ISO-8859-1" can handle danish characters, while the encoding "UTF-8" can´t. Is all information sent and received using UTF-8 and if so, could this be an option in GeoServer?
Java handles everything in UTF-8 internally, but UTF8 should be able
to handle that character afaik... my guess is that that char
is encoded as two bytes in UTF8, so decoding does not work well
if the reader is assuming the file is in UTF-8 while it is in
fact in ISO-8859-1.
I can read the file properly because I'm on Windows XP, and cp1252,
the charset used by default on Windows, it's really similar to
ISO-8859-1, whilst you're probably on Linux, where UTF8 is assumed
(and java defaults to the system defaults).
Anyways, I'm going to work on this a little bit more, then I'll
probably ask you to have a look at the results on your system.
Cheers
Andrea
Andrea Aime ha scritto:
Java handles everything in UTF-8 internally,
I was wrong, java uses utf-16 internally:
http://java.sun.com/javase/technologies/core/basic/intl/faq.jsp
Cheers
Andrea
Thanks.
Just to clearify. I am on Win XP SP2.
/Thomas
On 6/28/07, Andrea Aime <aaime@anonymised.com> wrote:
Thomas Rokkjær ha scritto:
Yes that is how it should look. So where do you think the problem is
originating from?
I know that the encoding “ISO-8859-1” can handle danish characters,
while the encoding “UTF-8” can´t. Is all information sent and received
using UTF-8 and if so, could this be an option in GeoServer?
Java handles everything in UTF-8 internally, but UTF8 should be able
to handle that character afaik… my guess is that that char
is encoded as two bytes in UTF8, so decoding does not work well
if the reader is assuming the file is in UTF-8 while it is in
fact in ISO-8859-1.
I can read the file properly because I’m on Windows XP, and cp1252,
the charset used by default on Windows, it’s really similar to
ISO-8859-1, whilst you’re probably on Linux, where UTF8 is assumed
(and java defaults to the system defaults).
Anyways, I’m going to work on this a little bit more, then I’ll
probably ask you to have a look at the results on your system.
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjær ha scritto:
Thanks.
Just to clearify. I am on Win XP SP2.
Sigh, then the error is in XML encoding, not in the shapefile reading 
I'll have a look at it as well
Cheers
Andrea
Thomas Rokkjær ha scritto:
Thanks.
Just to clearify. I am on Win XP SP2.
Thomas,
I'm getting the attached XML out of Geoserver,
but I don't get any error neither from Firefox
neither from IE7... shall the stroked o be
escaped instead of reported directly?
Cheers
Andrea
danish_point.gml.xml (2.28 KB)
Hi Andrea
Sorry for the late reply. But here goes…
The stroked o “ø” should be reported directly.
If I fetch the url, which is being used in my GetFeatureInfo and sends this directly to Firefox or IE then I get a correctly formated response from the GeoServer too (including the danish characters reported directly).
But when it is displayed within the index.html page the danish characters gives the beforementioned error in IE and are displayed in Firefox with a “?” or the classic “unknown symbol” instead of danish characters.
See the example below:
Layer
Hope this helps in solving this problem.
Best regards
Thomas Rokkjaer
On 6/28/07, Andrea Aime <aaime@…1…> wrote:
Thomas Rokkjær ha scritto:
Thanks.
Just to clearify. I am on Win XP SP2.
Thomas,
I’m getting the attached XML out of Geoserver,
but I don’t get any error neither from Firefox
neither from IE7… shall the stroked o be
escaped instead of reported directly?
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjær ha scritto:
Hi Andrea
Sorry for the late reply. But here goes...
The stroked o "ø" should be reported directly.
If I fetch the url, which is being used in my GetFeatureInfo and sends this directly to Firefox or IE then I get a correctly formated response from the GeoServer too (including the danish characters reported directly).
But when it is displayed within the index.html page the danish characters gives the beforementioned error in IE and are displayed in Firefox with a "?" or the classic "unknown symbol" instead of danish characters.
I see... which format do you use for GetFeatureInfo?
If it's XML and then you do some XSLT, it's the client side business
to handle the issue, because we generate correct XML.
If instead you're asking data in another format, such as HTML, then
yeah, I guess Geoserver is not properly escaping these character
into correct HTML escape codes (I'll have to look for a library that
is able to do proper HTML entity escaping).
Cheers
Andrea
My URL looks like the following (ie GML):
" http://infudv1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=brnby:testPoints_point&SRS=EPSG:25832&BBOX=710084.36,6168442.59,719205.09,6175139.87&WIDTH=600&HEIGHT=400&INFO_FORMAT=application/vnd.ogc.gml&FORMAT=image/png&FEATURE_COUNT=1&QUERY_LAYERS=brnby:testPoints_point&X=288&Y=192 "
GetFeatureInfo.xsl:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:wmc=“http://www.opengis.net/context” xmlns:xlink=" http://www.w3.org/1999/xlink" xmlns:xsl=“http://www.w3.org/1999/XSL/Transform” version=“1.0”><xsl:output method=“xml”/><xsl:strip-space elements=“*”/><xsl:param name=“queryLayer”>highways</xsl:param><xsl:param name=“xCoord”>1</xsl:param><xsl:param name=“yCoord”>1</xsl:param><xsl:param name=“infoFormat”>text/html</xsl:param><xsl:param name=“imgFormat”>image/png</xsl:param><xsl:param name=“featureCount”>1</xsl:param><xsl:variable name=“bbox”><xsl:value-of select=“/wmc: ViewContext/wmc:General/wmc:BoundingBox/@minx”/>,<xsl:value-of select=“/wmc:ViewContext/wmc:General/wmc:BoundingBox/@miny”/>,<xsl:value-of select=“/wmc:ViewContext/wmc:General/wmc:BoundingBox/@maxx “/>,<xsl:value-of select=”/wmc:ViewContext/wmc:General/wmc:BoundingBox/@maxy”/></xsl:variable><xsl:variable name=“width”><xsl:value-of select=“/wmc:ViewContext/wmc:General/wmc:Window/@width “/></xsl:variable><xsl:variable name=“height”><xsl:value-of select=”/wmc:ViewContext/wmc:General/wmc:Window/@height”/></xsl:variable><xsl:variable name=“srs” select=“/wmc: ViewContext/wmc:General/wmc:BoundingBox/@SRS”/><xsl:template match=“/”><xsl:apply-templates select=“wmc:ViewContext/wmc:LayerList”/>URL not calculated for layer=<xsl:value-of select=“$queryLayer”/></xsl:template><xsl:template match=“wmc:Layer”><xsl:if test=“contains($queryLayer,wmc:Name)”><xsl:variable name=“version”><xsl:value-of select=" wmc:Server/@version"/></xsl:variable><xsl:variable name=“baseUrl”><xsl:value-of select=“wmc:Server/wmc:OnlineResource/@xlink:href”/></xsl:variable><xsl:variable name=“firstJoin”>xsl:choose<xsl:when test=“substring($baseUrl,string-length($baseUrl))=‘?’”/><xsl:when test=“contains($baseUrl, ‘?’)”>&</xsl:when>xsl:otherwise?</xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select=“$baseUrl”/><xsl:value-of select=“$firstJoin”/>VERSION=<xsl:value-of select=“$version”/>&REQUEST=GetFeatureInfo&LAYERS=<xsl:value-of select=“$queryLayer”/>&SRS=<xsl:value-of select=“$srs”/>&BBOX=<xsl:value-of select=“$bbox”/>&WIDTH=<xsl:value-of select=“$width”/>&HEIGHT=<xsl:value-of select=“$height”/>&INFO_FORMAT=<xsl:value-of select=“$infoFormat”/>&FORMAT=<xsl:value-of select=“$imgFormat”/>&FEATURE_COUNT=<xsl:value-of select=“$featureCount”/>&QUERY_LAYERS=<xsl:value-of select=“$queryLayer”/>&X=<xsl:value-of select=“$xCoord”/>&Y=<xsl:value-of select=“$yCoord”/></xsl:if></xsl:template></xsl:stylesheet>
/Thomas
On 7/3/07, Andrea Aime <aaime@anonymised.com> wrote:
Thomas Rokkjær ha scritto:
Hi Andrea
Sorry for the late reply. But here goes…
The stroked o “ø” should be reported directly.
If I fetch the url, which is being used in my GetFeatureInfo and sends
this directly to Firefox or IE then I get a correctly formated response
from the GeoServer too (including the danish characters reported directly).
But when it is displayed within the index.html page the danish
characters gives the beforementioned error in IE and are displayed in
Firefox with a “?” or the classic “unknown symbol” instead of danish
characters.
I see… which format do you use for GetFeatureInfo?
If it’s XML and then you do some XSLT, it’s the client side business
to handle the issue, because we generate correct XML.
If instead you’re asking data in another format, such as HTML, then
yeah, I guess Geoserver is not properly escaping these character
into correct HTML escape codes (I’ll have to look for a library that
is able to do proper HTML entity escaping).
Cheers
Andrea
–
Med venlig hilsen
Thomas Rokkjær
Mobil 3095 0774
http://picasaweb.google.com/thomas.rokkjaer
Thomas Rokkjaer ha scritto:
My URL looks like the following (ie GML):
" http://infudv1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=brnby:testPoints_point&SRS=EPSG:25832&BBOX=710084.36,6168442.59,719205.09,6175139.87&WIDTH=600&HEIGHT=400&INFO_FORMAT=application/vnd.ogc.gml&FORMAT=image/png&FEATURE_COUNT=1&QUERY_LAYERS=brnby:testPoints_point&X=288&Y=192"
GetFeatureInfo.xsl:
<?xml version="1.0"?>
Hmmm... this look like a client side issue. The trouble is
that your XSLT does not handle the transformation from the direct
stroked o (valid in XML) to the HTML escape code.
May it be that you have to set the output method of xslt to html?
See this thread (found googling for "xslt escape"):
http://www.stylusstudio.com/xsllist/200406/post40240.html#
Cheers
Andrea