擅长:python、mysql、java
<p>它是<code>str</code>对象的附加初始值设定项,<a href="https://docs.python.org/3/library/stdtypes.html#str" rel="nofollow">is used when an object of type ^{<cd2>} (or ^{<cd3>}) is supplied</a>(由前缀<code>b'text'</code>表示)。在</p>
<p>它的默认值是<code>utf-8</code>,因为python3.5的默认编码是<code>utf-8</code>(而且它很正常)。在</p>
<p>它只是意味着如果传入一个<code>bytes</code>对象,编码<code>utf-8</code>将在默认情况下使用<strong>,<code>errors=strict</code>意味着编码错误将引发UnicodeError。它实质上是发出对<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">^{<cd10>}</a>的调用。在</p>
<p>当然,如果您愿意,您可以更改这些内容并使用<a href="https://docs.python.org/3.5/library/codecs.html#standard-encodings" rel="nofollow">another encoding</a>(比如<code>latin-1</code>)<a href="https://docs.python.org/3/library/codecs.html#codecs.register_error" rel="nofollow">or another level of errors</a>。在</p>