Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a cql filter as SQL. Im trying to parse this cql to OpenLayers.Filter using OpenLayers.Format.CQL.read() method. It all works fine since my input is ascii. When I type Turkish characters as VALUE an error occurs. I modifed regex belong to VALUE property in CQL.js as /(^('.+'|\d+(.\d*)?|.\d+))/ Now it accepts non-ascii characters but generated Filter is wrong. The regex i modified might affect somewhere.

What i try and what message i get actually like follow

var format_cql = new OpenLayers.Format.CQL;
format_cql.read("NAME = 'ŞAKİR'");

Error: ERROR: In parsing: ['ŞAKİR'], expected one of: VALUE: /^('\w+'|\d+(.\d*)?|.\d+)/

If i type SAKIR instead of ŞAKİR it returns a OpenLayers Comparison object well. It also doesnt allow to type space character in value.

Could someone please help me ?

Regards

share|improve this question
add comment

1 Answer

My friend helped me and changed regex of 'value' property in CQL.js as /^('([^ \t-~]|\w|\s)'|\d+(.\d)?|.\d+)/i It works well with unicode characters and spaces. Fyi.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.