Skip to main content
14 votes
Accepted

Change Shapefile data source encoding?

From the menubar, go to: Settings > Options > Data Sources > Data source handling and uncheck the Ignore shapefile encoding declaration setting: This sets all layers loaded into QGIS to be ...
Joseph's user avatar
  • 75.9k
11 votes

Change default data source encoding in QGIS to utf8

From Settings >> Data Sources >> Data source handling, you may try to uncheck the Ignore shapefile encoding declaration option. If you move the mouse cursor over the above option, this ...
mgri's user avatar
  • 16.2k
9 votes

How to display special German characters "ÄÜÖß" in a map?

In newer versions of QGIS you can right click the layer and select properties. In the first tab there is a section about layer information with the options for data source encoding. You can select UTF-...
Chris P's user avatar
  • 1,639
9 votes

Change shapefile encoding to ASCII in QGIS

Many of the existing encodings are ASCII compatible, so there is no need for a dedicated ASCII encoding. E.g. latin-1 (ISO 8859-1) is one of these. And it's also the one which shapefiles should be ...
Matthias Kuhn's user avatar
8 votes

Is it possible to change default encoding for QGIS?

Go to the "Settings -> Options -> Data Sources" menu, and look for the checkbox "Ignore shapefile encoding declaration", when you uncheck it, the default encoding (for shapefiles) will be 'set to' ...
NettaB's user avatar
  • 1,946
8 votes

How to fix encoding problem in shapefile importing?

I was facing the same problem last days, and that was due to german letters in shapefile attribute table, so for that I did the following: Simply, just click on option button and change UTF-8 to ...
Muhammad Abdullah's user avatar
8 votes
Accepted

Change encoding type for all files or whole project

you can use a python script for that task: group = QgsProject.instance().layerTreeRoot().children() layers = [ item.layer() for item in group ] #list of all layers for layer in layers: layer....
eurojam's user avatar
  • 10.9k
7 votes

Change Shapefile data source encoding?

To recapitulate the different location where you can set the encoding: When you open a shapefile: When you open a CSV: When you save a vector file: In the layer properties: And, as ...
Victor's user avatar
  • 1,852
7 votes
Accepted

Letters change when saving tab into shp in QGIS

You can use ISO 8859-1 encoding to read Spanish text correctly (along with various other countries).
Joseph's user avatar
  • 75.9k
7 votes
Accepted

GeoJSON attributes encoding limitation

GeoJSON is an extension of JSON, and you will find in RFC7159 JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32. The default encoding is UTF-8, and JSON texts that are encoded in UTF-8 are ...
AndreJ's user avatar
  • 76.7k
7 votes
Accepted

Encoding issue in QGIS while loading CSV file

When you import your CSV via Layer --> Add layer --> Add delimited text layer, you need to set the encoding of your CSV to UTF-8:
MrXsquared's user avatar
  • 34.5k
5 votes

Stop automatic ANSI_1252 to UTF-8 encoding when adding a DXF layer?

One possible solution to the problem: Open the DXF file in a texteditor and save the file with the encoding that is used by QGIS. In my case I had a DXF file exported from AutoCAD with encoding UTF-8, ...
GeogRaphy's user avatar
5 votes

SLD encoding in GeoSever on Ubuntu

If files created by Geoserver are in us-ascii, it means that the Java VM is running using this encoding. In your Geoserver starting script, add the Java option (JAVA_OPTS) -Dfile.encoding=UTF-8
JGH's user avatar
  • 42.1k
5 votes
Accepted

How to change character set in all columns of many tables in Postgresql / PostGIS?

This won't solve any of your problems and will be an epic cluster mess-up. The "database" has three types of encoding, Internal encoding. Import encoding. Client encoding. The Internal Encoding ...
Evan Carroll's user avatar
  • 7,081
5 votes
Accepted

QGIS tools change special characters to unreadables

Use: orgEncoding=QgsSettings().value('/Processing/encoding') # save setting QgsSettings().setValue('/Processing/encoding', 'utf-8') # set uft8 # run qgis tool import processing processing.run("...
Mike -EZUSoft-'s user avatar
4 votes

Change Shapefile data source encoding?

When you use Save As ..., you have to select a different filename, and Add file to canvas. As a consequence, you MUST save the project too to get the new shapefile in it. The unsaved project still ...
AndreJ's user avatar
  • 76.7k
4 votes
Accepted

Geoserver arabic labels and attributes doesn't show in right encoding character set

What I do in cases like this is change the encoding in the dbf file (part of the shapefile collection). This can be done with LibreOffice, for example. First make a backup copy of the original ...
Micha's user avatar
  • 15.7k
4 votes
Accepted

QGIS Processing algorithm cannot deal with special characters in input

What I always do to handle unicode in expressions is to prepend a u to the expression string, in this way: expr = QgsExpression( u"\"MELYSEG\" > {} AND \"TLP\" LIKE '{}'".format( depth, nev ) ) ...
Germán Carrillo's user avatar
4 votes

QGIS Processing algorithm cannot deal with special characters in input

You need to use the encode() function in python: expr = QgsExpression(" \"MELYSEG\">'{}' AND \"TLP\"LIKE'{}'".format(depth, nev).encode('ascii'))
Shiko's user avatar
  • 2,893
4 votes

QGIS Processing algorithm cannot deal with special characters in input

You need to add the encode() function for your string input. So try replacing: expr = QgsExpression(" \"MELYSEG\">'{}' AND \"TLP\"LIKE'{}'".format(depth, nev)) with this: expr = QgsExpression("...
Joseph's user avatar
  • 75.9k
4 votes

OWSLib - ValueError: All strings must be XML compatible: Unicode or ASCII

You should replace : myquery = PropertyIsEqualTo('csw:AnyText', 'été') with: myquery = PropertyIsEqualTo('csw:AnyText', u'été') The prefix indicates a unicode string : 3.1.3. Unicode Strings
Bisontine's user avatar
4 votes
Accepted

Export Shapefile with UTF-8 encoding for non-english characters in GeoPandas?

Just use dff. to_file(out,encoding='')and where is the encoding try your language specific versions until you find it.
user10070732's user avatar
4 votes
Accepted

how to change encoding of a geopackage in QGIS 3

There is no need to change the character encoding of GeoPackages because it is mandatory to use UTF. See http://www.geopackage.org/spec120/index.html#_ogc_geopackage_encoding_standard: TEXT – A ...
user30184's user avatar
  • 66.2k
3 votes

ogr2ogr: encoding issues when importing from Oracle Spatial to PostGIS

Try this Oracle environment variable: NLS_LANG=AMERICAN_AMERICA.UTF8
Martin Jensen's user avatar
3 votes
Accepted

Exporting from Excel to csv and import in QGIS retaining encoding/special characters (with workaround)?

Have you tried using Notepad as an in-between-step? After creating your excel file, copy everything in a notepad file, then choose "save as". Make sure that you change the type of file as "All files", ...
Vale's user avatar
  • 941
3 votes

Get all data source encoding list

The QgsVectorDataProvider class has the availableEncodings() method which provides you with a list of available encoding types: QgsVectorDataProvider.availableEncodings()
Joseph's user avatar
  • 75.9k
3 votes
Accepted

Preserving special chars using osgeo.ogr.Driver to shapefile in Python?

Got it! An environment variable needs to be set. It can be set either in the shell: export SHAPE_ENCODING="utf-8" or within the script: os.environ['SHAPE_ENCODING'] = "utf-8" I prefer to set ...
jollege's user avatar
  • 283
3 votes
Accepted

What is 'data source encoding' in QGIS?

In most cases, you can leave it to System. If you read data from OpenStreetMap, it will be encoded UTF-8. So if you experience strange characters in parts of the world where the latin alphabet is ...
AndreJ's user avatar
  • 76.7k
3 votes
Accepted

Displaying degree symbol in popup template of ArcGIS API for JavaScript?

Why Didn't you use directly the ° character ? otherwise use js String.fromCharCode function to render char from It's ascii code (degree = 176 ) like bellow : var lvEsriPopupT = new esri.dijit....
Bourbia Brahim's user avatar
3 votes
Accepted

Encoding problem

Thanks to the comments I saw that this issue is due to my user name on windows which has an accent Loïc. I changed it.
Loïc Poncin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible