當讀中文檔時遇到UnicodeDecodeError: 'big5' codec can't decode byte 0xf9 in position 35210: illegal multibyte sequence
應該要使用Big5
發生錯誤時就使用cp950

fileContent = open("C:/Users/Vincent/Dropbox/project/caculate_Time/all.txt", 'r' ,encoding = 'Big5')
listContent = fileContent.read()

fileContent = open("C:/Users/Vincent/Dropbox/project/caculate_Time/all.txt", 'r' ,encoding = 'cp950')
listContent = fileContent.read()

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 晨柚 的頭像
    晨柚

    晨柚的部落格

    晨柚 發表在 痞客邦 留言(0) 人氣()