quotes and apostrophes in dbf

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Thu Aug 4 13:53:50 EDT 2005


I noticed that dbf-records containing apostrophes or quotes in one of 
their fields don't show up in the attribute query results when such a 
field is referenced inside the expression.

For instance, a query like

'[ORT_NAME_I]' =~ /.*(A|a)(N|n)(D|d)(R|r).*/

produces the expected results except for the record where ORT_NAME_I is
Sant'Andrea, which doesn't show up due to the apostrophe (things behave 
exactly the same on other dbf-data, using different queries and working 
on different machines, when there's char #34 or #39 around).

I guess that things go wrong somewhere inside the parser which is called
from msEvalExpression. In fact, what we probably need to do is to escape 
any quote and apostrophe in a record as things are ok when I surround 
[ORT_NAME_I] in the example above with quotes instead of apostrophes, 
but that, viceversa, hides any record containing a quote. Of course, I 
may be wrong as well.

Has anybody else experienced this behavior too?

Best regards,
-- 
--------------------------------------------------------------------
Andreas Albarello
Territorium Online Srl/GmbH
andreas.albarello at territoriumonline.com
www.territoriumonline.com
--------------------------------------------------------------------



More information about the mapserver-users mailing list