[Gvsig_english] Wrong URL-encoding for non-ASCII characters in a filter
Rahkonen Jukka
Jukka.Rahkonen at mmmtike.fi
Tue Aug 7 15:54:10 CEST 2012
Hi,
There is a problem if WFS attribute filter contains special characters like åäöÅÄÖ
This is how my attribute filter looks in the Query area of the WFS Filter tab
"kunta_ni1" = 'Saarijärvi'
This is the request that gvSIG is sending
http://188.64.1.61/cgi-bin/mapserver_wfs?REQUEST=GetFeature&SERVICE=WFS&TYPENAME=municipalities&FILTER=<Filter%20xmlns:ogc="http://www.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml"%20xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"%20xsi:schemaLocation="http://www.opengis.net/ogc%20../filter/1.0.0/filter.xsd%20http://www.opengis.net/gml%20../gml/2.1.2/geometry.xsd"><PropertyIsEqualTo><PropertyName>kunta_ni1</PropertyName><Literal>Saarij%E4rvi</Literal></PropertyIsEqualTo></Filter>&VERSION=1.1.0&EXCEPTIONS=XML&MAXFEATURES=10000
There is wrong URL-encoding in <Literal>Saarij%E4rvi</Literal>
Letter "ä" as correctly URL-encoded is %C3%A4
If I edit the GetFeature request above accordingly to contain <Literal>Saarij%C3%E4rvi</Literal>it works
http://188.64.1.61/cgi-bin/mapserver_wfs?REQUEST=GetFeature&SERVICE=WFS&TYPENAME=municipalities&FILTER=<Filter%20xmlns:ogc="http://www.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml"%20xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"%20xsi:schemaLocation="http://www.opengis.net/ogc%20../filter/1.0.0/filter.xsd%20http://www.opengis.net/gml%20../gml/2.1.2/geometry.xsd"><PropertyIsEqualTo><PropertyName>kunta_ni1</PropertyName><Literal>Saarij%C3%A4rvi</Literal></PropertyIsEqualTo></Filter>&VERSION=1.1.0&EXCEPTIONS=XML&MAXFEATURES=10000
gvSIG seems to do the URL-encoding wrong for other characters do. If I place this string into the filter
test_åäöÅÄÖ_test
it comes out as
<Literal>test_%E5%E4%F6%C5%C4%D6_test</Literal>
but it should come like
<Literal>test_%C3%A5%C3%A4%C3%B6%C3%85%C3%84%C3%96_test</Literal>
I am using gvSIG 1.12 RC2 on Windows XP. Java version is 1.7.0_02 and I did installation from
http://downloads.gvsig.org/download/gvsig-desktop/dists/1.12.0/builds/1414/gvSIG-desktop-1.12.0-1414-RC2-win-x86-standard.exe
Locale is Finland-Finnish.
Regards,
-Jukka Rahkonen-
More information about the Gvsig_internacional
mailing list