Bug report #21250

QGIS 3 Layer Filter error with Unicode field name

Added by Heather Hillers 10 months ago. Updated 9 months ago.

Status:Open
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:3.5(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29068

Description

Hello,

If a user has a shape file with a field name that has an Umlaut in it ("EIGENTÜMER") and they make a Filter on that layer "EIGENTÜMER" = 'MEINFIRMA' then the attribute table will correctly reflect the filter (with many returns) but no geometries will appear on the canvas. Filtering by a field with a normal ASCII name results in normal behavior. (I have warned the user that field names should never have unicode in them.)

test.qpj (656 Bytes) Heather Hillers, 2019-02-13 02:01 PM

test.prj (388 Bytes) Heather Hillers, 2019-02-13 02:01 PM

test.shp (212 Bytes) Heather Hillers, 2019-02-13 02:01 PM

test.dbf (814 Bytes) Heather Hillers, 2019-02-13 02:01 PM

test.shx (132 Bytes) Heather Hillers, 2019-02-13 02:01 PM

Screenshot_20190213_152700.png (121 KB) Alessandro Pasotti, 2019-02-13 03:33 PM

History

#1 Updated by Giovanni Manghi 10 months ago

  • Status changed from Open to Feedback

Please attach sample data.

#2 Updated by Heather Hillers 10 months ago

Here is a 4 point shapefile with 2 text fields- EIGENTÜM and EIGEN, each having the same text values. Compare the filter "EIGENTÜM"='APPLE' with the filter "EIGEN"='APPLE'.

#3 Updated by Giovanni Manghi 10 months ago

  • Status changed from Feedback to Open
  • Category changed from Map Legend to Vectors

#4 Updated by Alessandro Pasotti 10 months ago

  • Assignee set to Alessandro Pasotti

#5 Updated by Alessandro Pasotti 10 months ago

How did you create the filter? From the legend with right+click?

Which encoding did you choose for the layer (see my attachment)?

#6 Updated by Alessandro Pasotti 10 months ago

  • Resolution deleted (worksforme)

#7 Updated by Alessandro Pasotti 10 months ago

  • Affected QGIS version changed from 3.4.4 to 3.5(master)

#8 Updated by Heather Hillers 10 months ago

Hi,

Encoding on the Layer is set to System. I am on Windows 7. The System Encoding should be latin1.

From the Legend, I right clicked on the layer and added the filter.

I also tested by opening layer properties and adding a Provider Feature Filter in the Source Tab. The same behavior resulted.

#9 Updated by Heather Hillers 10 months ago

I tested with the layer encoding explicitly set to latin1 (iso-8859-1), with the same result.

#10 Updated by Alessandro Pasotti 10 months ago

  • Priority changed from Normal to High
  • Regression? changed from No to Yes

#11 Updated by Alessandro Pasotti 10 months ago

  • Assignee deleted (Alessandro Pasotti)

#12 Updated by Giovanni Manghi 10 months ago

Heather Hillers wrote:

I tested with the layer encoding explicitly set to latin1 (iso-8859-1), with the same result.

does it work as expected on 2.18?

#13 Updated by Alessandro Pasotti 10 months ago

@Giovanni: didn't you notice that I checked the regression flag?

#14 Updated by Giovanni Manghi 10 months ago

Alessandro Pasotti wrote:

@Giovanni: didn't you notice that I checked the regression flag?

nope, here notifications from Redmine arrive hours later than comments/changes are posted.

#15 Updated by Luigi Pirelli 10 months ago

  • Assignee set to Luigi Pirelli

#16 Updated by Luigi Pirelli 10 months ago

note: If source file is recoded in utf-8 it does not generate the problem

#17 Updated by Luigi Pirelli 10 months ago

  • Assignee deleted (Luigi Pirelli)

I wasn't able to find a fix not where is the problem... on monday I'll try debugging also gdal calls. In the meantime I leave it unassigned if someone is able to find a solution

#18 Updated by Giovanni Manghi 9 months ago

  • Status changed from Feedback to Open

Also available in: Atom PDF