我要吐槽一下Python的文档,从open函数
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
第几段介绍encoding跳转到codecs,很长的一篇翻到最后才介绍:
encodings.utf_8_sig — UTF-8 codec with BOM signature
This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful encoder this is only done once (on the first write to the byte stream). On decoding, an optional UTF-8 encoded BOM at the start of the data will be skipped.
感觉文档太难用了,甚至比Qt的都不如。
还是说这个问题有更好的查询路径?
【 在 adoal 的大作中提到: 】
: 用utf-8-sig
:
--
FROM 183.251.227.*