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 ?


1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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