I'm using CQL filter to extract certain data from my GeoServer layer.
var source = new ol.source.Vector({
loader: function (extent, resolution, projection) {
var url = "http://localhost/geoserver/visualization/ows?service=WFS"
+ "&version=1.1.0&request=GetFeature"
+ "&typeName=visualization:".concat(inputTable)
+ '&outputFormat=text/javascript'
+ "&format_options=callback:loadFeatures"
+ '&srsname=EPSG:3857'
+ filter;
$.ajax({ url: url, dataType: 'jsonp', jsonp: false });
console.log(filter);
console.log(url);
}
});
Notice the filter
string as the final parameter at url
. If I normally input the feature name using alphabet text, it will return the result. But if I use other than alphabet (UTF-8, EUC-KR) it won't return anything.
&cql_filter=branchCode='N01821' -> works
&cql_filter=방향='S' -> korean word, doesn't work
If I print the URL, the Korean strings give me this error
<ows:ExceptionText>Could not parse CQL filter list. Lexical error at line 1, column 1. Encountered: "\ubc29" (48169), after : "" Parsing : 방향='S'.</ows:ExceptionText>
Anyone knows the reason why and the solution?