@@ -612,7 +612,7 @@ msgstr "以下标准错误处理方案也可通过模块层级函数的方式来
612612msgid ""
613613"Implements the ``'strict'`` error handling: each encoding or decoding error "
614614"raises a :exc:`UnicodeError`."
615- msgstr ""
615+ msgstr "实现 ``'strict'`` 错误处理方案:每个编码或解码错误都会引发 :exc:`UnicodeError`。 "
616616
617617#: ../../library/codecs.rst:423
618618msgid ""
@@ -621,43 +621,51 @@ msgid ""
621621" the codec), and ``'\\ ufffd'`` (the Unicode replacement character) for "
622622"decoding errors."
623623msgstr ""
624+ "实现 ``'replace'`` 错误处理方案 (仅用于 :term:`文本编码 <text encoding>`):编码错误替换为 ``'?'`` "
625+ "(并由编解码器编码),解码错误替换为 ``'\\ ufffd'`` (Unicode 替换字符)。"
624626
625627#: ../../library/codecs.rst:431
626628msgid ""
627629"Implements the ``'ignore'`` error handling: malformed data is ignored and "
628630"encoding or decoding is continued without further notice."
629- msgstr ""
631+ msgstr "实现 ``'ignore'`` 错误处理方案:忽略错误格式的数据并且不加进一步通知就继续执行。 "
630632
631633#: ../../library/codecs.rst:437
632634msgid ""
633635"Implements the ``'xmlcharrefreplace'`` error handling (for encoding with "
634636":term:`text encodings <text encoding>` only): the unencodable character is "
635637"replaced by an appropriate XML character reference."
636638msgstr ""
639+ "实现 ``'xmlcharrefreplace'`` 错误处理方案 (仅用于 :term:`文本编码 <text encoding>` "
640+ "的编码过程):不可编码的字符将以适当的 XML 字符引用进行替换。"
637641
638642#: ../../library/codecs.rst:444
639643msgid ""
640644"Implements the ``'backslashreplace'`` error handling (for :term:`text "
641645"encodings <text encoding>` only): malformed data is replaced by a "
642646"backslashed escape sequence."
643647msgstr ""
648+ "实现 ``'backslashreplace'`` 错误处理方案 (仅用于 :term:`文本编码 <text "
649+ "encoding>`):错误格式的数据将以带反斜杠的转义序列进行替换。"
644650
645651#: ../../library/codecs.rst:450
646652msgid ""
647653"Implements the ``'namereplace'`` error handling (for encoding with "
648654":term:`text encodings <text encoding>` only): the unencodable character is "
649655"replaced by a ``\\ N{...}`` escape sequence."
650656msgstr ""
657+ "实现 ``'namereplace'`` 错误处理方案 (仅用于 :term:`文本编码 <text encoding>` "
658+ "的编码过程):不可编码的字符将以 ``\\ N{...}`` 转义序列进行替换。"
651659
652660#: ../../library/codecs.rst:460
653661msgid "Stateless Encoding and Decoding"
654- msgstr ""
662+ msgstr "无状态的编码和解码 "
655663
656664#: ../../library/codecs.rst:462
657665msgid ""
658666"The base :class:`Codec` class defines these methods which also define the "
659667"function interfaces of the stateless encoder and decoder:"
660- msgstr ""
668+ msgstr "基本 :class:`Codec` 类定义了这些方法,同时还定义了无状态编码器和解码器的函数接口: "
661669
662670#: ../../library/codecs.rst:468
663671msgid ""
@@ -666,25 +674,29 @@ msgid ""
666674" bytes object using a particular character set encoding (e.g., ``cp1252`` or"
667675" ``iso-8859-1``)."
668676msgstr ""
677+ "编码 *input* 对象并返回一个元组 (输出对象, 消耗长度)。 例如,:term:`text encoding` 会使用特定的字符集编码格式 "
678+ "(例如 ``cp1252`` 或 ``iso-8859-1``) 将字符串转换为字节串对象。"
669679
670680#: ../../library/codecs.rst:473 ../../library/codecs.rst:495
671681msgid ""
672682"The *errors* argument defines the error handling to apply. It defaults to "
673683"``'strict'`` handling."
674- msgstr ""
684+ msgstr "*errors* 参数定义了要应用的错误处理方案。 默认为 ``'strict'`` 处理方案。 "
675685
676686#: ../../library/codecs.rst:476
677687msgid ""
678688"The method may not store state in the :class:`Codec` instance. Use "
679689":class:`StreamWriter` for codecs which have to keep state in order to make "
680690"encoding efficient."
681691msgstr ""
692+ "此方法不一定会在 :class:`Codec` 实例中保存状态。 可使用必须保存状态的 :class:`StreamWriter` "
693+ "作为编解码器以便高效地进行编码。"
682694
683695#: ../../library/codecs.rst:480
684696msgid ""
685697"The encoder must be able to handle zero length input and return an empty "
686698"object of the output object type in this situation."
687- msgstr ""
699+ msgstr "编码器必须能够处理零长度的输入并在此情况下返回输出对象类型的空对象。 "
688700
689701#: ../../library/codecs.rst:486
690702msgid ""
@@ -693,20 +705,25 @@ msgid ""
693705"bytes object encoded using a particular character set encoding to a string "
694706"object."
695707msgstr ""
708+ "解码 *input* 对象并返回一个元组 (输出对象, 消耗长度)。 例如,:term:`text encoding` "
709+ "的解码操作会使用特定的字符集编码格式将字节串对象转换为字符串对象。"
696710
697711#: ../../library/codecs.rst:491
698712msgid ""
699713"For text encodings and bytes-to-bytes codecs, *input* must be a bytes object"
700714" or one which provides the read-only buffer interface -- for example, buffer"
701715" objects and memory mapped files."
702716msgstr ""
717+ "对于文本编码格式和字节到字节编解码器,*input* 必须为一个字节串对象或提供了只读缓冲区接口的对象 -- 例如,缓冲区对象和映射到内存的文件。"
703718
704719#: ../../library/codecs.rst:498
705720msgid ""
706721"The method may not store state in the :class:`Codec` instance. Use "
707722":class:`StreamReader` for codecs which have to keep state in order to make "
708723"decoding efficient."
709724msgstr ""
725+ "此方法不一定会在 :class:`Codec` 实例中保存状态。 可使用必须保存状态的 :class:`StreamReader` "
726+ "作为编解码器以便高效地进行解码。"
710727
711728#: ../../library/codecs.rst:502
712729msgid ""
0 commit comments