【问题标题】:QGIS 3.0 python(3.6) UnicodeDecodeError: 'cp949QGIS 3.0 python(3.6) UnicodeDecodeError: 'cp949
【发布时间】:2018-02-28 02:40:42
【问题描述】:

enter image description here

print(u"한글")

Traceback(最近一次调用最后一次): 运行代码中的文件“C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\code.py”,第 91 行 执行(代码,self.locals) 文件“”,第 1 行,在 enter code here UnicodeDecodeError:“cp949”编解码器无法解码位置 8 中的 0xed 字节: 非法多字节序列

在 python 2.7 中,它执行没有任何问题。在python 3.6中,代码中的韩文字符串出现UnicodeDecodeError错误。

【问题讨论】:

  • 您不能在没有任何进一步解释的情况下仅反刍解释器吐出的内容,并期望我们解决您的问题。请解释一下。

标签: python qgis


【解决方案1】:

首先,参考上传的图片。

QGIS 2.x 没有问题,但是 QGIS 3.x 有图像问题。

qgis 3.x python 控制台中的print('한글'),没有错误#한글是英文韩文。

qgis 3.x python控制台编辑器中的print('한글'),错误

print('aaa') #eng 注释在 qgis 3.x python 控制台编辑器中,没有错误

print('aaa') #한글주석 in qgis 3.x python console editor, error #also, 韩语注释有问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-10
    • 2018-12-04
    • 2021-05-18
    • 1970-01-01
    • 2018-09-17
    • 2011-10-28
    • 2023-02-08
    相关资源
    最近更新 更多