2016年3月10日 星期四

Python- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 0: invalid start byte

OS : Windows 7
Python : Python 3.5
Tool : Python IDLE , Notepad++

Status :

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 0: invalid start byte



Cause :
    Notepad++ saves files in ANSI as the default encoding.

Solution : 
    Changes the encoding for hello.txt : convert to UTF-8 (No BOM)




沒有留言:

張貼留言