I got this error message when I tried to perfoming a spatial join.

An error has occured while executing Python code :
Traceback (most recent call last):
  File "C:/Users/Laurent/.qgis2/python/plugins\spatialJoin\spatialjoin.py", line 186, in applyJoin
    self.tra.ce( exp)
  File "C:/Users/Laurent/.qgis2/python/plugins\spatialJoin\spatialjoin.py", line 45, in ce
    print string
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 17: ordinal not in range(128)

Python Version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS Version: 2.8.1-Wien Wien, exported

Any idea on this?

  • 2
    Does your layer or filename contain accents (eg. Á, è, ö etc)? This could be a reason you receive a unicode error. – Joseph Apr 21 '15 at 10:17

This error is usually caused by presence of some characters that are not understood in the content. example: non-english letters First check for these characters in your code and replace them.

| improve this answer | |

This Error very common in Turkish Language. Need to check Turkish character use in Folder Names.


Türkçe kullananlar için sıklıkla karşılaşılan bir hata. Türkçe dosya isimlerinde Türkçe Karakter kullanmaktan kaçınarak bu sorun aşılabilir

| improve this answer | |
  • This seems to confirm what might cause the issue, but doesn't suggest any solution. What do you do if you find that you are using such characters – nmtoken Feb 9 '17 at 14:36
  • I change the folder name and it solve this problem. I dont know another way to solve the problem. – Can Bayat Dec 22 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.