如何解決QCC517x QCC307x Build Code時出現UnicodeDecodeError: 'ascii'

由於我們使用的Windows是繁體中文版, 所以在Build QCC517x code時會出現UnicodeDecodeError: 'ascii' codec can't decode byte 0xa7 in position 0: ordinal not in range(128)問題.
有以下有二種解決方法.

1. Windows->地區->系統管理->非Unicode程式的語言->變更系統地區設定->勾選"Beta:使用Unicode UTF-8 提供全球語言支援(U)"
    優點: 使用新版ADKToolkit時不用再做修改.
    缺點: 這會使少部份在Windows的應該程式會程現亂碼, 比如UltraEdit功能列.



2. 在ADKToolkit裡的exceptions.py檔裡加入讓系統載入繁體中文"big5" 如下紅閊字體示. 


    優點: 不會導致Windows其他應用程式亂碼.
    缺點: 更換新版ADKToolkit時必須修改該檔案.

Defines  a base class and all the exceptions raisable by both the build and

deploy services and

their helpers

"""

import sys

reload(sys)

sys.setdefaultencoding('big5')

import traceback

import maker.err_codes as erc

★博文內容均由個人提供,與平台無關,如有違法或侵權,請與網站管理員聯繫。

★文明上網,請理性發言。內容一周內被舉報5次,發文人進小黑屋喔~

評論