2

I am a master's student in Ecology and Environment in Portugal. It's been a few months since I had my first contact with QGIS.

When using a shapefile, in the attribute table, I select by expression, and when selecting a value, it gives me an error because of the special characters. My notebook is Windows 11. I've already looked online for how to solve this problem and all I found was saying to change the table font to UTF-8, but it didn't help.

Attached is the image of the error. How can I fix this?

error special characters

Vince
  • 20,017
  • 15
  • 45
  • 64
  • 5
    Did you try this? https://gis.stackexchange.com/a/15914/88814 If it doesn't work: can you share a sample of your shapefile (don't forget to share all sidecar files!). By the way: shapefiles are an old format with many limitations. Consider using Geopackage instead. – Babel Nov 24 '23 at 13:48
  • 1
    Welcome to GIS SE. As a new user please take the [Tour]. Error messages should always be included in the Question body as text (images aren't legible on all devices, and can't be searched by others with the same error). – Vince Nov 24 '23 at 14:21
  • 3
    You didn't need to change the Data source encoding to UTF-8 but to the right encoding (the right one may be hard to find but if UTF-8 didn't work the second one to try is probably WINDOWS-1252) – J.R Nov 24 '23 at 16:42
  • Thank you!! It worked with WINDOWS-1252!!! – Sandy Morgado Nov 27 '23 at 14:45
  • @SandyMorgado you should mark the correct answer. Hope you found the answer. – ANDRÉS Mar 05 '24 at 13:22

1 Answers1

2

You didn't need to change the Data source encoding to UTF-8 but to the ''right'' encoding (ie. the one your data was originally created with).

The right one may be hard to find (as there are so many) but if UTF-8 didn't work and as you seem to be situated in western Europe the second one to try is probably WINDOWS-1252

People often give the advice to change to UTF-8 because UTF-8 is the recommended encoding for many application and as so is the most likely to be used but that doesn't mean that's UTF-8 is always the solution...

J.R
  • 16,090
  • 1
  • 19
  • 52