Bug report #19124
UTF-8 characters not supported in python script despite # -*- coding: utf-8 -*-
|Affected QGIS version:||3.0.3||Regression?:||No|
|Operating System:||Win64||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||26954|
The following lines generate an error "SyntaxError: invalid character in identifier"
ϕ = radians(latitude)
λ = radians(longitude)
#3 Updated by Jürgen Fischer almost 3 years ago
- Resolution set to worksforme
- Status changed from Feedback to Closed
Pasting this into the python console works fine for me - both on Windows and Linux. On the command line you have to make sure that you're actually using python3 ad python2 doesn't support non-ascii identifiers (ie. on OSGeo4W by running
call py3_env.bat. On Linux you might need
#!/usr/bin/env python3 is python 2 is otherwise used).