Tuesday, September 25, 2018

QGIS 'Add Delimited Text Layer' with Special (Chinese Language) characters

Add Delimited Text Layer in QGIS isn't new. In fact it is the easiest way to import a list of coordinate points in .CSV file into QGIS as a map layer.

What is new here is that the CSV file has some columns with Chinese characters. And such characters are not well read in CSV file formats. For example here below is how the original data looks in excel .xlsx format.

After saving it as .csv for import into QGIS via "Add Delimited Text Layer" menu, it looks this below. Obviously this is not what is expected in the CSV file.

Excel (.xlsx) is not recognized in QGIS "Add Delimited Text Layer", so we can't use the excel file directly. We have to find a way for the CSV file to read the characters correctly or we look into using another file format such as the text file.

The Solution:
Here is the solution to make CSV file read the Chinese characters correctly...

Step 1: Open the Excel file.
Step 2: Navigate to File > Save As.

Step 3: Name the file and select Unicode Text (*.txt) as the type, then click Save.

Step 4: Open the file in Notepad. You will need to replace the tabs (space between each column) with commas.

Step 5: Go to File > Save As. Name the file, and change Encoding to UTF-8. On the file name, change the extension from .txt to .csv. Click Save.

Step 6: Import the newer CSV file in QGIS

Now we have our Chinese language characters within QGIS mapping environment for further analysis.

Thant is it.

P.S: These steps will work for other languages that have special characters difficult to keep in a CSV file. 

No comments:

Post a Comment