Bug report #4227
Vector layer query fails if SQL text contains not ascii characters (but works in advanced search in the table of attributes)
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||14184|
Steps to reproduce:
1) Add a vector layer with attribute data in different encoding;
2) Open layer definition query dialog;
3) Enter any clause that contains non-latin letter (i.e. FOO like '%ē%').
Result - it reports 0 rows matching.
Same clause within attribute table "advanced query dialog" results in numerous results.
If dataset encoding matches current system encoding, SQL part runs fine and bug is not present.
Tested with 1.7.0 and current git.
#2 Updated by peppo - almost 10 years ago
I encountered a quite similar issue. When the query on a shape layer (on windows with system encoding) contains special characters like ü the coresponding feature is not selected. When I take the the same shape file and use the "save as ..." with utf-8, the query works fine on the new layer.
I think this behaviour is problematic, because one might not notice a single feature missing and it changes the result of a query.
If anybody needs example files, I would be happy to provide them.
#7 Updated by Giovanni Manghi over 9 years ago
The problem is worst as the same issue is there even if the layer is opened with the correct encoding and the query contains non-ascii chars
which is in iso-8859-1
"Freguesia" = 'PECHÃO'
it will return 0 results
but the same query will work from the advances search in the attribute table
#8 Updated by Giovanni Manghi over 9 years ago
- Subject changed from Vector layer data query fails to select objects if SQL text contains not default encoding characters to Vector layer query fails if SQL text contains not ascii characters (but works in advanced search in the table of attributes)
- Priority changed from Normal to High
tested on master