Skip to main content
deleted 326 characters in body
Source Link
aldo_tapia
  • 13.8k
  • 5
  • 32
  • 58

Is QGIS opening those files in UTF-8?

I've been experimenting the same issue before, but on the other side. I work on macOS with UTF-8 as default encoding. When I open a file created with a different encoding (primarily windows-xxxx) I lost accents. The solution: just change encoding in layer properties.

No accent:

enter image description here

SettingsUse:

enter image description here

writeOGR(obj=for.ana, dsn=".", layer="for_export",driver="ESRI Shapefile", layer_options = "ENCODING=UTF-8")

Changing settingsInstead of:

enter image description here

writeOGR(obj=for.ana, dsn=".", layer="for_export",driver="ESRI Shapefile", encoding="UTF-8")

With accents:

enter image description herelayer_options, you add the parameters to ogr2ogr shell command. Check GDAL documentation for more options.

Is QGIS opening those files in UTF-8?

I've been experimenting the same issue before, but on the other side. I work on macOS with UTF-8 as default encoding. When I open a file created with a different encoding (primarily windows-xxxx) I lost accents. The solution: just change encoding in layer properties.

No accent:

enter image description here

Settings:

enter image description here

Changing settings:

enter image description here

With accents:

enter image description here

Use:

writeOGR(obj=for.ana, dsn=".", layer="for_export",driver="ESRI Shapefile", layer_options = "ENCODING=UTF-8")

Instead of:

writeOGR(obj=for.ana, dsn=".", layer="for_export",driver="ESRI Shapefile", encoding="UTF-8")

With layer_options, you add the parameters to ogr2ogr shell command. Check GDAL documentation for more options.

Source Link
aldo_tapia
  • 13.8k
  • 5
  • 32
  • 58

Is QGIS opening those files in UTF-8?

I've been experimenting the same issue before, but on the other side. I work on macOS with UTF-8 as default encoding. When I open a file created with a different encoding (primarily windows-xxxx) I lost accents. The solution: just change encoding in layer properties.

No accent:

enter image description here

Settings:

enter image description here

Changing settings:

enter image description here

With accents:

enter image description here