@@ -12,7 +12,7 @@ msgid ""
1212msgstr ""
1313"Project-Id-Version : Python 3.11\n "
1414"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2023-12-08 16:33 +0000\n "
15+ "POT-Creation-Date : 2023-12-15 16:34 +0000\n "
1616"PO-Revision-Date : 2023-05-24 02:09+0000\n "
1717"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2023\n "
1818"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -138,13 +138,13 @@ msgstr "以下API是C宏和静态内联函数,用于快速检查和访问Unico
138138msgid ""
139139"Return true if the object *obj* is a Unicode object or an instance of a "
140140"Unicode subtype. This function always succeeds."
141- msgstr ""
141+ msgstr "如果对象 *obj* 是 Unicode 对象或 Unicode 子类型的实例则返回真值。 此函数总是会成功执行。 "
142142
143143#: ../../c-api/unicode.rst:98
144144msgid ""
145145"Return true if the object *obj* is a Unicode object, but not an instance of "
146146"a subtype. This function always succeeds."
147- msgstr ""
147+ msgstr "如果对象 *obj* 是一个 Unicode 对象,但不是某个子类型的实例则返回真值。 此函数总是会成功执行。 "
148148
149149#: ../../c-api/unicode.rst:104
150150msgid ""
@@ -166,7 +166,7 @@ msgstr ""
166166msgid ""
167167"Return the length of the Unicode string, in code points. *unicode* has to "
168168"be a Unicode object in the \" canonical\" representation (not checked)."
169- msgstr ""
169+ msgstr "返回以码位点数量表示的 Unicode 字符串长度。 *unicode* 必须为“规范”表示的 Unicode 对象(不会检查这一点)。 "
170170
171171#: ../../c-api/unicode.rst:130
172172msgid ""
@@ -192,12 +192,15 @@ msgid ""
192192"*unicode* has to be a Unicode object in the \" canonical\" representation "
193193"(not checked)."
194194msgstr ""
195+ "返回一个 PyUnicode 类型的常量(见上文),指明此see above) that indicate how many bytes per "
196+ "character this Unicode 对象用来存储每个字符所使用的字节数。 *unicode* 必须为“规范”表示的 Unicode "
197+ "对象(不会检查这一点)。"
195198
196199#: ../../c-api/unicode.rst:165
197200msgid ""
198201"Return a void pointer to the raw Unicode buffer. *unicode* has to be a "
199202"Unicode object in the \" canonical\" representation (not checked)."
200- msgstr ""
203+ msgstr "返回一个指向原始 Unicode 缓冲区的空指针。 *unicode* 必须为“规范”表示的 Unicode 对象(不会检查这一点)。 "
201204
202205#: ../../c-api/unicode.rst:174
203206msgid ""
@@ -224,6 +227,8 @@ msgid ""
224227"\" canonical\" representation. This is less efficient than "
225228":c:func:`PyUnicode_READ` if you do multiple consecutive reads."
226229msgstr ""
230+ "从 Unicode 对象 *unicode* 读取一个字符,必须为“规范”表示形式。 如果你执行多次连续读取则此函数的效率将低于 "
231+ ":c:func:`PyUnicode_READ`。"
227232
228233#: ../../c-api/unicode.rst:204
229234msgid ""
@@ -232,6 +237,7 @@ msgid ""
232237" is always an approximation but more efficient than iterating over the "
233238"string."
234239msgstr ""
240+ "返回适合基于 *unicode* 创建另一个字符串的最大码位点,该参数必须为“规范”表示形式。 这始终是一种近似但比在字符串上执行迭代更高效。"
235241
236242#: ../../c-api/unicode.rst:213
237243msgid ""
@@ -496,7 +502,7 @@ msgstr ""
496502msgid ""
497503"Create a Unicode object from a UTF-8 encoded null-terminated char buffer "
498504"*str*."
499- msgstr ""
505+ msgstr "根据 UTF-8 编码的以空值结束的字符缓冲区 *str* 创建一个 Unicode 对象。 "
500506
501507#: ../../c-api/unicode.rst:454
502508msgid ""
@@ -902,7 +908,7 @@ msgstr ""
902908msgid ""
903909"Return a substring of *unicode*, from character index *start* (included) to "
904910"character index *end* (excluded). Negative indices are not supported."
905- msgstr ""
911+ msgstr "返回 *unicode* 的一个子串,从字符索引 *start* (包括) 到字符索引 *end* (不包括)。 不支持负索引号。 "
906912
907913#: ../../c-api/unicode.rst:673
908914msgid ""
@@ -911,6 +917,9 @@ msgid ""
911917"particular, a :exc:`SystemError` if *buflen* is smaller than the length of "
912918"*unicode*). *buffer* is returned on success."
913919msgstr ""
920+ "将字符串 *unicode* 拷贝到一个 UCS4 缓冲区,包括一个空字符,如果设置了 *copy_null* 的话。 出错时返回 ``NULL`` "
921+ "并设置一个异常(特别是当 *buflen* 小于 *unicode* 的长度时,将设置 :exc:`SystemError` 异常)。 成功时返回 "
922+ "*buffer*。"
914923
915924#: ../../c-api/unicode.rst:683
916925msgid ""
@@ -919,6 +928,8 @@ msgid ""
919928":exc:`MemoryError` set. The returned buffer always has an extra null code "
920929"point appended."
921930msgstr ""
931+ "将字符串 *unicode* 拷贝到使用 :c:func:`PyMem_Malloc` 分配的新 UCS4 缓冲区。 如果执行失败,将返回 "
932+ "``NULL`` 并设置 :exc:`MemoryError`。 返回的缓冲区将总是会添加一个额外的空码位。"
922933
923934#: ../../c-api/unicode.rst:692
924935msgid "Deprecated Py_UNICODE APIs"
@@ -1203,6 +1214,8 @@ msgid ""
12031214"itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on "
12041215"failure."
12051216msgstr ""
1217+ "根据给定的 *size* 的 :c:type:`wchar_t` 缓冲区 *wstr* 创建一个 Unicode 对象。 传入 ``-1`` 作为 "
1218+ "*size* 表示该函数必须使用 :c:func:`!wcslen` 自动计算缓冲区长度。 失败时将返回 ``NULL``。"
12061219
12071220#: ../../c-api/unicode.rst:950
12081221msgid ""
@@ -1217,6 +1230,11 @@ msgid ""
12171230"null characters, which would cause the string to be truncated when used with"
12181231" most C functions."
12191232msgstr ""
1233+ "将 Unicode 对象内容拷贝到 :c:type:`wchar_t` 缓冲区 *wstr* 中。 至多拷贝 *size* 个 "
1234+ ":c:type:`wchar_t` 字符(不包括可能存在于末尾的空结束字符)。 返回拷贝的 :c:type:`wchar_t` "
1235+ "字符数量或者在发生错误时返回 ``-1``。 请注意结果 :c:expr:`wchar_t*` 字符可能有或没有表示结束的空值。 "
1236+ "调用方需要负责在应用程序有些要求时确保 :c:expr:`wchar_t*` 字符串是以空值结束的。 此外,还要注意 "
1237+ ":c:expr:`wchar_t*` 字符串可能包含空字符,这将导致在大多数 C 函数中使用时字符串被截断。"
12201238
12211239#: ../../c-api/unicode.rst:963
12221240msgid ""
@@ -1310,6 +1328,9 @@ msgid ""
13101328" looked up using the Python codec registry. Return ``NULL`` if an exception"
13111329" was raised by the codec."
13121330msgstr ""
1331+ "通过解码已编码字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 *encoding* 和 *errors* 具有与 "
1332+ ":func:`str` 内置函数中同名形参相同的含义。 要使用的编解码将使用 Python 编解码器注册表来查找。 如果编解码器引发了异常则返回 "
1333+ "``NULL``。"
13131334
13141335#: ../../c-api/unicode.rst:1030
13151336msgid ""
@@ -1336,6 +1357,8 @@ msgid ""
13361357"Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string"
13371358" *str*. Return ``NULL`` if an exception was raised by the codec."
13381359msgstr ""
1360+ "通过解码 UTF-8 编码的字节串 *str* 的的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回 "
1361+ "``NULL``。"
13391362
13401363#: ../../c-api/unicode.rst:1052
13411364msgid ""
@@ -1536,6 +1559,8 @@ msgid ""
15361559"Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string"
15371560" *str*. Return ``NULL`` if an exception was raised by the codec."
15381561msgstr ""
1562+ "通过解码 UTF-7 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回 "
1563+ "``NULL``。"
15391564
15401565#: ../../c-api/unicode.rst:1216
15411566msgid ""
@@ -1562,6 +1587,8 @@ msgid ""
15621587"encoded string *str*. Return ``NULL`` if an exception was raised by the "
15631588"codec."
15641589msgstr ""
1590+ "通过解码 Unicode-Escape 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回"
1591+ " ``NULL``。"
15651592
15661593#: ../../c-api/unicode.rst:1237
15671594msgid ""
@@ -1586,6 +1613,8 @@ msgid ""
15861613"encoded string *str*. Return ``NULL`` if an exception was raised by the "
15871614"codec."
15881615msgstr ""
1616+ "通过解码 Raw-Unicode-Escape 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 "
1617+ "如果编解码器引发了异常则返回 ``NULL``。"
15891618
15901619#: ../../c-api/unicode.rst:1257
15911620msgid ""
@@ -1611,6 +1640,8 @@ msgid ""
16111640"Create a Unicode object by decoding *size* bytes of the Latin-1 encoded "
16121641"string *str*. Return ``NULL`` if an exception was raised by the codec."
16131642msgstr ""
1643+ "通过解码 Latin-1 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回 "
1644+ "``NULL``。"
16141645
16151646#: ../../c-api/unicode.rst:1277
16161647msgid ""
@@ -1636,6 +1667,8 @@ msgid ""
16361667"Create a Unicode object by decoding *size* bytes of the ASCII encoded string"
16371668" *str*. Return ``NULL`` if an exception was raised by the codec."
16381669msgstr ""
1670+ "通过解码 ASCII 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回 "
1671+ "``NULL``。"
16391672
16401673#: ../../c-api/unicode.rst:1297
16411674msgid ""
@@ -1673,6 +1706,8 @@ msgid ""
16731706" using the given *mapping* object. Return ``NULL`` if an exception was "
16741707"raised by the codec."
16751708msgstr ""
1709+ "通过使用给定的 *mapping* 对象解码已编码字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 "
1710+ "如果编解码器引发了异常则返回 ``NULL``。"
16761711
16771712#: ../../c-api/unicode.rst:1320
16781713msgid ""
@@ -1758,6 +1793,7 @@ msgid ""
17581793"Create a Unicode object by decoding *size* bytes of the MBCS encoded string "
17591794"*str*. Return ``NULL`` if an exception was raised by the codec."
17601795msgstr ""
1796+ "通过解码 MBCS 编码的字节串 *str* 的 *size* 个字节创建一个 Unicode 对象。 如果编解码器引发了异常则返回 ``NULL``。"
17611797
17621798#: ../../c-api/unicode.rst:1377
17631799msgid ""
@@ -1828,6 +1864,8 @@ msgid ""
18281864"CRLF is considered to be one line break. If *keepends* is ``0``, the Line "
18291865"break characters are not included in the resulting strings."
18301866msgstr ""
1867+ "根据分行符来拆分 Unicode 字符串,返回一个 Unicode 字符串的列表。 CRLF 将被视为一个分行符。 如果 *keepends* 为 "
1868+ "``0``,则行分隔符将不包括在结果字符串中。"
18311869
18321870#: ../../c-api/unicode.rst:1437
18331871msgid ""
0 commit comments