Bug report #20474
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 211: illegal multibyte sequence
Status: | Open | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | PyQGIS Console | ||
Affected QGIS version: | 3.0.3 | Regression?: | No |
Operating System: | Windows 10 (64 bit) | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 28294 |
Description
I use windows OS, this error occured when I built python script which contains chinese character.
the python file was readly encoding by 'utf-8', It did not work when
`exec(open('C:/Users/xxx/QGIS/scripts/test.py'.encode('utf-8')).read())` in the python console. but
`exec(open('C:/Users/xxx/QGIS/scripts/test.py'.encode('utf-8'), 'rb').read())` worked well. It maybe
an error of python but I did not sure.
Related issues
History
#1 Updated by law water about 6 years ago
- Copied to Bug report #20475: UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 211: illegal multibyte sequence added