Bug report #21250

QGIS 3 Layer Filter error with Unicode field name

Added by Heather Hillers almost 6 years ago. Updated over 5 years 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 almost 6 years ago

  • Status changed from Open to Feedback

Please attach sample data.

#2 Updated by Heather Hillers almost 6 years 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 almost 6 years ago

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

#4 Updated by Alessandro Pasotti almost 6 years ago

  • Assignee set to Alessandro Pasotti

#5 Updated by Alessandro Pasotti almost 6 years 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 almost 6 years ago

  • Resolution deleted (worksforme)

#7 Updated by Alessandro Pasotti almost 6 years ago

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

#8 Updated by Heather Hillers almost 6 years 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 almost 6 years ago

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

#10 Updated by Alessandro Pasotti almost 6 years ago

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

#11 Updated by Alessandro Pasotti almost 6 years ago

  • Assignee deleted (Alessandro Pasotti)

#12 Updated by Giovanni Manghi almost 6 years 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 almost 6 years ago

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

#14 Updated by Giovanni Manghi almost 6 years 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 almost 6 years ago

  • Assignee set to Luigi Pirelli

#16 Updated by Luigi Pirelli almost 6 years ago

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

#17 Updated by Luigi Pirelli almost 6 years 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 over 5 years ago

  • Status changed from Feedback to Open

Also available in: Atom PDF