[Featureserver] Handling non-ASCII characters in attribute query

Peter Robins fs at peterrobins.co.uk
Fri Nov 6 08:59:09 EST 2009


When I started using FS back in March, I reported a problem with DBM
failing when there were non-ascii characters in the feature
attributes. http://featureserver.org/pipermail/featureserver/2009-March/000390.html
I've at last got around to investigating this properly, and find there
are actually 2 problems.

1. DBM.py is not allowing for non-ascii characters at all; dbmdiff
attached is a patch for this, converting the feature attribute to
utf-8
2. back in March I reported that if I made the change in this patch,
dbm would no longer fail but it wouldn't match any non-ASCII
characters in a query. This is because FS is not currently catering
for url encoding in the querystring, so it doesn't work with any
datasource. ISTM that handlers.py is the place to do this, so I added
an unquote and tested against my data, and it seems to work.
handlersdiff attached is what I changed. As I'm using cgi, I only
changed the cgi method; if handlers.py is the correct place to do
this, I'll change the other 2 methods as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbmdiff
Type: application/octet-stream
Size: 672 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/featureserver/attachments/20091106/17699b39/dbmdiff.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: handlersdiff
Type: application/octet-stream
Size: 653 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/featureserver/attachments/20091106/17699b39/handlersdiff.obj


More information about the Featureserver mailing list