标签: python-3.x unicode utf-8
我正在读取(二进制)文件,并且程序在命中b'\xe2\x80\xa6'时会暂停。
b'\xe2\x80\xa6'
'''UnicodeEncodeError: 'charmap' codec can't encode character '\u2026' in position 0: character maps to <undefined> ''' print(b'\xe2\x80\xa6'.decode('utf-8')) # HORIZONTAL ELLIPSIS (U+2026)