-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathunicode.po
More file actions
2150 lines (1825 loc) · 96 KB
/
unicode.po
File metadata and controls
2150 lines (1825 loc) · 96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Rafael Fontenelle <[email protected]>, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-25 16:03+0000\n"
"PO-Revision-Date: 2025-07-18 19:57+0000\n"
"Last-Translator: Rafael Fontenelle <[email protected]>, 2025\n"
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../c-api/unicode.rst:6
msgid "Unicode Objects and Codecs"
msgstr "Unicode对象和编解码器"
#: ../../c-api/unicode.rst:12
msgid "Unicode Objects"
msgstr "Unicode对象"
#: ../../c-api/unicode.rst:14
msgid ""
"Since the implementation of :pep:`393` in Python 3.3, Unicode objects "
"internally use a variety of representations, in order to allow handling the "
"complete range of Unicode characters while staying memory efficient. There "
"are special cases for strings where all code points are below 128, 256, or "
"65536; otherwise, code points must be below 1114112 (which is the full "
"Unicode range)."
msgstr ""
"自从python3.3中实现了 :pep:`393` "
"以来,Unicode对象在内部使用各种表示形式,以便在保持内存效率的同时处理完整范围的Unicode字符。对于所有代码点都低于128、256或65536的字符串,有一些特殊情况;否则,代码点必须低于1114112(这是完整的Unicode范围)。"
#: ../../c-api/unicode.rst:20
msgid ""
"UTF-8 representation is created on demand and cached in the Unicode object."
msgstr "UTF-8 表示将按需创建并缓存在 Unicode 对象中。"
#: ../../c-api/unicode.rst:23
msgid ""
"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 "
"with deprecated APIs. See :pep:`623` for more information."
msgstr ""
":c:type:`Py_UNICODE` 表示形式在 Python 3.12 中同被弃用的 API 一起被移除了,查阅 :pep:`623` "
"以获得更多信息。"
#: ../../c-api/unicode.rst:29
msgid "Unicode Type"
msgstr "Unicode类型"
#: ../../c-api/unicode.rst:31
msgid ""
"These are the basic Unicode object types used for the Unicode implementation"
" in Python:"
msgstr "以下是用于Python中Unicode实现的基本Unicode对象类型:"
#: ../../c-api/unicode.rst:38
msgid ""
"These types are typedefs for unsigned integer types wide enough to contain "
"characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with "
"single Unicode characters, use :c:type:`Py_UCS4`."
msgstr ""
"这些类型是无符号整数类型的类型定义,其宽度足以分别包含 32 位、16 位和 8 位字符。 当需要处理单个 Unicode 字符时,请使用 "
":c:type:`Py_UCS4`。"
#: ../../c-api/unicode.rst:47
msgid ""
"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit "
"type depending on the platform."
msgstr "这是 :c:type:`wchar_t` 的类型定义,根据平台的不同它可能为 16 位类型或 32 位类型。"
#: ../../c-api/unicode.rst:50
msgid ""
"In previous versions, this was a 16-bit type or a 32-bit type depending on "
"whether you selected a \"narrow\" or \"wide\" Unicode version of Python at "
"build time."
msgstr "在以前的版本中,这是16位类型还是32位类型,这取决于您在构建时选择的是“窄”还是“宽”Unicode版本的Python。"
#: ../../c-api/unicode.rst:60
msgid ""
"These subtypes of :c:type:`PyObject` represent a Python Unicode object. In "
"almost all cases, they shouldn't be used directly, since all API functions "
"that deal with Unicode objects take and return :c:type:`PyObject` pointers."
msgstr ""
"这些关于 :c:type:`PyObject` 的子类型表示了一个 Python Unicode 对象。 "
"在几乎所有情形下,它们不应该被直接使用,因为所有处理 Unicode 对象的 API 函数都接受并返回 :c:type:`PyObject` "
"类型的指针。"
#: ../../c-api/unicode.rst:69
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python Unicode type."
" It is exposed to Python code as ``str``."
msgstr ""
"这个 :c:type:`PyTypeObject` 实例代表 Python Unicode 类型。 它作为 ``str`` 公开给 Python 代码。"
#: ../../c-api/unicode.rst:73
msgid ""
"The following APIs are C macros and static inlined functions for fast checks"
" and access to internal read-only data of Unicode objects:"
msgstr "以下API是C宏和静态内联函数,用于快速检查和访问Unicode对象的内部只读数据:"
#: ../../c-api/unicode.rst:78
msgid ""
"Return true if the object *obj* is a Unicode object or an instance of a "
"Unicode subtype. This function always succeeds."
msgstr "如果对象 *obj* 是 Unicode 对象或 Unicode 子类型的实例则返回真值。 此函数总是会成功执行。"
#: ../../c-api/unicode.rst:84
msgid ""
"Return true if the object *obj* is a Unicode object, but not an instance of "
"a subtype. This function always succeeds."
msgstr "如果对象 *obj* 是一个 Unicode 对象,但不是某个子类型的实例则返回真值。 此函数总是会成功执行。"
#: ../../c-api/unicode.rst:90
msgid "Returns ``0``. This API is kept only for backward compatibility."
msgstr "返回 ``0``。 此 API 仅为向下兼容而保留。"
#: ../../c-api/unicode.rst:94
msgid "This API does nothing since Python 3.12."
msgstr "此 API 从 Python 3.12 起将不做任何事。"
#: ../../c-api/unicode.rst:100
msgid ""
"Return the length of the Unicode string, in code points. *unicode* has to "
"be a Unicode object in the \"canonical\" representation (not checked)."
msgstr "返回以码位点数量表示的 Unicode 字符串长度。 *unicode* 必须为“规范”表示的 Unicode 对象(不会检查这一点)。"
#: ../../c-api/unicode.rst:110
msgid ""
"Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 "
"integer types for direct character access. No checks are performed if the "
"canonical representation has the correct character size; use "
":c:func:`PyUnicode_KIND` to select the right function."
msgstr ""
"返回一个用于直接字符访问的指向转换为 UCS1、UCS2 或 UCS4 整数类型的规范表示的指针。 如果规范表示具有正确的字符大小,则不执行检查;使用 "
":c:func:`PyUnicode_KIND` 选择正确的函数。"
#: ../../c-api/unicode.rst:122
msgid "Return values of the :c:func:`PyUnicode_KIND` macro."
msgstr "返回 :c:func:`PyUnicode_KIND` 宏的值。"
#: ../../c-api/unicode.rst:126
msgid "``PyUnicode_WCHAR_KIND`` has been removed."
msgstr "``PyUnicode_WCHAR_KIND`` 已被移除。"
#: ../../c-api/unicode.rst:132
msgid ""
"Return one of the PyUnicode kind constants (see above) that indicate how "
"many bytes per character this Unicode object uses to store its data. "
"*unicode* has to be a Unicode object in the \"canonical\" representation "
"(not checked)."
msgstr ""
"返回一个 PyUnicode 类型的常量(见上文),指明此see above) that indicate how many bytes per "
"character this Unicode 对象用来存储每个字符所使用的字节数。 *unicode* 必须为“规范”表示的 Unicode "
"对象(不会检查这一点)。"
#: ../../c-api/unicode.rst:141
msgid ""
"Return a void pointer to the raw Unicode buffer. *unicode* has to be a "
"Unicode object in the \"canonical\" representation (not checked)."
msgstr "返回一个指向原始 Unicode 缓冲区的空指针。 *unicode* 必须为“规范”表示的 Unicode 对象(不会检查这一点)。"
#: ../../c-api/unicode.rst:150
msgid ""
"Write into a canonical representation *data* (as obtained with "
":c:func:`PyUnicode_DATA`). This function performs no sanity checks, and is "
"intended for usage in loops. The caller should cache the *kind* value and "
"*data* pointer as obtained from other calls. *index* is the index in the "
"string (starts at 0) and *value* is the new code point value which should be"
" written to that location."
msgstr ""
"写入一个规范表示的 *data* (如同用 :c:func:`PyUnicode_DATA` 获取)。 此函数不会执行正确性检查,被设计为在循环中使用。"
" 调用者应当如同从其他调用中获取一样缓存 *kind* 值和 *data* 指针。 *index* 是字符串中的索引号 (从 0 开始) 而 "
"*value* 是应写入该位置的新码位值。"
#: ../../c-api/unicode.rst:163
msgid ""
"Read a code point from a canonical representation *data* (as obtained with "
":c:func:`PyUnicode_DATA`). No checks or ready calls are performed."
msgstr "从规范表示的 *data* (如同用 :c:func:`PyUnicode_DATA` 获取) 中读取一个码位。 不会执行检查或就绪调用。"
#: ../../c-api/unicode.rst:171
msgid ""
"Read a character from a Unicode object *unicode*, which must be in the "
"\"canonical\" representation. This is less efficient than "
":c:func:`PyUnicode_READ` if you do multiple consecutive reads."
msgstr ""
"从 Unicode 对象 *unicode* 读取一个字符,必须为“规范”表示形式。 如果你执行多次连续读取则此函数的效率将低于 "
":c:func:`PyUnicode_READ`。"
#: ../../c-api/unicode.rst:180
msgid ""
"Return the maximum code point that is suitable for creating another string "
"based on *unicode*, which must be in the \"canonical\" representation. This"
" is always an approximation but more efficient than iterating over the "
"string."
msgstr ""
"返回适合基于 *unicode* 创建另一个字符串的最大码位点,该参数必须为“规范”表示形式。 这始终是一种近似但比在字符串上执行迭代更高效。"
#: ../../c-api/unicode.rst:189
msgid ""
"Return ``1`` if the string is a valid identifier according to the language "
"definition, section :ref:`identifiers`. Return ``0`` otherwise."
msgstr "如果字符串按照语言定义是合法的标识符则返回 ``1``,参见 :ref:`identifiers` 小节。 否则返回 ``0``。"
#: ../../c-api/unicode.rst:192
msgid ""
"The function does not call :c:func:`Py_FatalError` anymore if the string is "
"not ready."
msgstr "如果字符串尚未就绪则此函数不会再调用 :c:func:`Py_FatalError`。"
#: ../../c-api/unicode.rst:198
msgid "Unicode Character Properties"
msgstr "Unicode字符属性"
#: ../../c-api/unicode.rst:200
msgid ""
"Unicode provides many different character properties. The most often needed "
"ones are available through these macros which are mapped to C functions "
"depending on the Python configuration."
msgstr "Unicode提供了许多不同的字符特性。最常需要的宏可以通过这些宏获得,这些宏根据Python配置映射到C函数。"
#: ../../c-api/unicode.rst:207
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a whitespace character."
msgstr "根据 *ch* 是否为空白字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:212
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a lowercase character."
msgstr "根据 *ch* 是否为小写字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:217
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an uppercase character."
msgstr "根据 *ch* 是否为大写字符返回 ``1`` 或 ``0``"
#: ../../c-api/unicode.rst:222
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a titlecase character."
msgstr "根据 *ch* 是否为标题化的大小写返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:227
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a linebreak character."
msgstr "根据 *ch* 是否为换行类字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:232
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a decimal character."
msgstr "根据 *ch* 是否为十进制数字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:237
msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character."
msgstr "根据 *ch* 是否为数码类字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:242
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a numeric character."
msgstr "根据 *ch* 是否为数值类字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:247
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character."
msgstr "根据 *ch* 是否为字母类字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:252
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric "
"character."
msgstr "根据 *ch* 是否为字母数字类字符返回 ``1`` 或 ``0``。"
#: ../../c-api/unicode.rst:257
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in"
" the sense of :meth:`str.isprintable`."
msgstr "根据 *ch* 是否为可打印字符返回 ``1`` 或 ``0``,基于 :meth:`str.isprintable` 来判断。"
#: ../../c-api/unicode.rst:261
msgid "These APIs can be used for fast direct character conversions:"
msgstr "这些 API 可用于快速直接的字符转换:"
#: ../../c-api/unicode.rst:266
msgid "Return the character *ch* converted to lower case."
msgstr "返回转换为小写形式的字符 *ch*。"
#: ../../c-api/unicode.rst:268 ../../c-api/unicode.rst:276
#: ../../c-api/unicode.rst:284
msgid "This function uses simple case mappings."
msgstr "此函数使用简单的大小写映射。"
#: ../../c-api/unicode.rst:274
msgid "Return the character *ch* converted to upper case."
msgstr "返回转换为大写形式的字符 *ch*。"
#: ../../c-api/unicode.rst:282
msgid "Return the character *ch* converted to title case."
msgstr "返回转换为标题大小写形式的字符 *ch*。"
#: ../../c-api/unicode.rst:290
msgid ""
"Return the character *ch* converted to a decimal positive integer. Return "
"``-1`` if this is not possible. This function does not raise exceptions."
msgstr "将字符 *ch* 转换为十进制正整数返回。 如果无法转换则返回 ``-1``。 此函数不会引发异常。"
#: ../../c-api/unicode.rst:296
msgid ""
"Return the character *ch* converted to a single digit integer. Return ``-1``"
" if this is not possible. This function does not raise exceptions."
msgstr "将字符 *ch* 转换为单个数码位的整数返回。 如果无法转换则返回 ``-1``。 此函数不会引发异常。"
#: ../../c-api/unicode.rst:302
msgid ""
"Return the character *ch* converted to a double. Return ``-1.0`` if this is "
"not possible. This function does not raise exceptions."
msgstr "将字符 *ch* 转换为双精度浮点数返回。 如果无法转换则返回 ``-1.0``。 此函数不会引发异常。"
#: ../../c-api/unicode.rst:306
msgid "These APIs can be used to work with surrogates:"
msgstr "这些 API 可被用来操作代理项:"
#: ../../c-api/unicode.rst:310
msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)."
msgstr "检测 *ch* 是否为代理项 (``0xD800 <= ch <= 0xDFFF``)。"
#: ../../c-api/unicode.rst:314
msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)."
msgstr "检测 *ch* 是否为高代理项 (``0xD800 <= ch <= 0xDBFF``)。"
#: ../../c-api/unicode.rst:318
msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)."
msgstr "检测 *ch* 是否为低代理项 (``0xDC00 <= ch <= 0xDFFF``)。"
#: ../../c-api/unicode.rst:322
msgid ""
"Join two surrogate characters and return a single :c:type:`Py_UCS4` value. "
"*high* and *low* are respectively the leading and trailing surrogates in a "
"surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must "
"be in the range [0xDC00; 0xDFFF]."
msgstr ""
"合并两个代理项字符并返回单个 :c:type:`Py_UCS4` 值。 *high* 和 *low* 分别为一个代理项对的开头和末尾代理项。 "
"*high* 取值范围必须为 [0xD800; 0xDBFF] 而 *low* 取值范围必须为 [0xDC00; 0xDFFF]。"
#: ../../c-api/unicode.rst:329
msgid "Creating and accessing Unicode strings"
msgstr "创建和访问 Unicode 字符串"
#: ../../c-api/unicode.rst:331
msgid ""
"To create Unicode objects and access their basic sequence properties, use "
"these APIs:"
msgstr "要创建 Unicode 对象和访问其基本序列属性,请使用这些 API:"
#: ../../c-api/unicode.rst:336
msgid ""
"Create a new Unicode object. *maxchar* should be the true maximum code "
"point to be placed in the string. As an approximation, it can be rounded up"
" to the nearest value in the sequence 127, 255, 65535, 1114111."
msgstr ""
"创建一个新的 Unicode 对象。 *maxchar* 应为可放入字符串的实际最大码位。 作为一个近似值,它可被向上舍入到序列 127, 255, "
"65535, 1114111 中最接近的值。"
#: ../../c-api/unicode.rst:340
msgid ""
"This is the recommended way to allocate a new Unicode object. Objects "
"created using this function are not resizable."
msgstr "这是分配新的 Unicode 对象的推荐方式。 使用此函数创建的对象不可改变大小。"
#: ../../c-api/unicode.rst:343
msgid "On error, set an exception and return ``NULL``."
msgstr "发生错误时,将设置异常并返回 ``NULL``。"
#: ../../c-api/unicode.rst:351
msgid ""
"Create a new Unicode object with the given *kind* (possible values are "
":c:macro:`PyUnicode_1BYTE_KIND` etc., as returned by "
":c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* "
"units of 1, 2 or 4 bytes per character, as given by the kind."
msgstr ""
"以给定的 *kind* 创建一个新的 Unicode 对象(可能的值为 :c:macro:`PyUnicode_1BYTE_KIND` 等,即 "
":c:func:`PyUnicode_KIND` 所返回的值)。 *buffer* 必须指向由此分类所给出的,以每字符 1, 2 或 4 字节单位的 "
"*size* 大小的数组。"
#: ../../c-api/unicode.rst:356
msgid ""
"If necessary, the input *buffer* is copied and transformed into the "
"canonical representation. For example, if the *buffer* is a UCS4 string "
"(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the "
"UCS1 range, it will be transformed into UCS1 "
"(:c:macro:`PyUnicode_1BYTE_KIND`)."
msgstr ""
"如有必要,输入 *buffer* 将被拷贝并转换为规范表示形式。 例如,如果 *buffer* 是一个 UCS4 字符串 "
"(:c:macro:`PyUnicode_4BYTE_KIND`) 且仅由 UCS1 范围内的码位组成,它将被转换为 UCS1 "
"(:c:macro:`PyUnicode_1BYTE_KIND`)。"
#: ../../c-api/unicode.rst:367
msgid ""
"Create a Unicode object from the char buffer *str*. The bytes will be "
"interpreted as being UTF-8 encoded. The buffer is copied into the new "
"object. The return value might be a shared object, i.e. modification of the "
"data is not allowed."
msgstr ""
"根据字符缓冲区 *str* 创建一个 Unicode 对象。 字节数据将按 UTF-8 编码格式来解读。 缓冲区会被拷贝到新的对象中。 "
"返回值可以是一个共享对象,即其数据不允许修改。"
#: ../../c-api/unicode.rst:373
msgid "This function raises :exc:`SystemError` when:"
msgstr "此函数会因以下情况而引发 :exc:`SystemError`:"
#: ../../c-api/unicode.rst:375
msgid "*size* < 0,"
msgstr "*size* < 0,"
#: ../../c-api/unicode.rst:376
msgid "*str* is ``NULL`` and *size* > 0"
msgstr "*str* 为 ``NULL`` 且 *size* > 0"
#: ../../c-api/unicode.rst:378
msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore."
msgstr "*str* == ``NULL`` 且 *size* > 0 不再被允许。"
#: ../../c-api/unicode.rst:384
msgid ""
"Create a Unicode object from a UTF-8 encoded null-terminated char buffer "
"*str*."
msgstr "根据 UTF-8 编码的以空值结束的字符缓冲区 *str* 创建一个 Unicode 对象。"
#: ../../c-api/unicode.rst:390
msgid ""
"Take a C :c:func:`printf`\\ -style *format* string and a variable number of "
"arguments, calculate the size of the resulting Python Unicode string and "
"return a string with the values formatted into it. The variable arguments "
"must be C types and must correspond exactly to the format characters in the "
"*format* ASCII-encoded string."
msgstr ""
"接受一个 C :c:func:`printf` 风格的 *format* 字符串和可变数量的参数,计算结果 Python Unicode "
"字符串的大小并返回包含已格式化值的字符串。 可变数量的参数必须均为 C 类型并且必须恰好与 *format* ASCII 编码字符串中的格式字符相对应。"
#: ../../c-api/unicode.rst:396
msgid ""
"A conversion specifier contains two or more characters and has the following"
" components, which must occur in this order:"
msgstr "转换标记符包含两个或更多字符并具有以下组成,且必须遵循此处规定的顺序:"
#: ../../c-api/unicode.rst:399
msgid "The ``'%'`` character, which marks the start of the specifier."
msgstr "``'%'`` 字符,用于标记转换符的起始。"
#: ../../c-api/unicode.rst:401
msgid ""
"Conversion flags (optional), which affect the result of some conversion "
"types."
msgstr "转换旗标(可选),用于影响某些转换类型的结果。"
#: ../../c-api/unicode.rst:404
msgid ""
"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the "
"actual width is given in the next argument, which must be of type "
":c:expr:`int`, and the object to convert comes after the minimum field width"
" and optional precision."
msgstr ""
"最小字段宽度(可选)。 如果指定为 ``'*'`` (星号),则实际宽度会在下一参数中给出,该参数必须为 :c:expr:`int` "
"类型,要转换的对象则放在最小字段宽度和可选精度之后。"
#: ../../c-api/unicode.rst:409
msgid ""
"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If"
" specified as ``'*'`` (an asterisk), the actual precision is given in the "
"next argument, which must be of type :c:expr:`int`, and the value to convert"
" comes after the precision."
msgstr ""
"精度(可选),以在 ``'.'`` (点号) 之后加精度值的形式给出。 如果指定为 ``'*'`` (星号),则实际精度会在下一参数中给出,该参数必须为"
" :c:expr:`int` 类型,要转换的对象则放在精度之后。"
#: ../../c-api/unicode.rst:414
msgid "Length modifier (optional)."
msgstr "长度修饰符(可选)。"
#: ../../c-api/unicode.rst:416
msgid "Conversion type."
msgstr "转换类型。"
#: ../../c-api/unicode.rst:418
msgid "The conversion flag characters are:"
msgstr "转换旗标为:"
#: ../../c-api/unicode.rst:423
msgid "Flag"
msgstr "标志位"
#: ../../c-api/unicode.rst:423
msgid "Meaning"
msgstr "含意"
#: ../../c-api/unicode.rst:425
msgid "``0``"
msgstr "``0``"
#: ../../c-api/unicode.rst:425
msgid "The conversion will be zero padded for numeric values."
msgstr "转换将为数字值填充零字符。"
#: ../../c-api/unicode.rst:427
msgid "``-``"
msgstr "``-``"
#: ../../c-api/unicode.rst:427
msgid ""
"The converted value is left adjusted (overrides the ``0`` flag if both are "
"given)."
msgstr "转换值将靠左对齐(如果同时给出则会覆盖 ``0`` 旗标)。"
#: ../../c-api/unicode.rst:431
msgid ""
"The length modifiers for following integer conversions (``d``, ``i``, ``o``,"
" ``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by "
"default):"
msgstr ""
"以下整数转换的长度修饰符 (``d``, ``i``, ``o``, ``u``, ``x``, or ``X``) 指明参数的类型 (默认为 "
":c:expr:`int`):"
#: ../../c-api/unicode.rst:438
msgid "Modifier"
msgstr "修饰符"
#: ../../c-api/unicode.rst:438
msgid "Types"
msgstr "类型"
#: ../../c-api/unicode.rst:440
msgid "``l``"
msgstr "``l``"
#: ../../c-api/unicode.rst:440
msgid ":c:expr:`long` or :c:expr:`unsigned long`"
msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`"
#: ../../c-api/unicode.rst:442
msgid "``ll``"
msgstr "``ll``"
#: ../../c-api/unicode.rst:442
msgid ":c:expr:`long long` or :c:expr:`unsigned long long`"
msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`"
#: ../../c-api/unicode.rst:444
msgid "``j``"
msgstr "``j``"
#: ../../c-api/unicode.rst:444
msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`"
msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`"
#: ../../c-api/unicode.rst:446
msgid "``z``"
msgstr "``z``"
#: ../../c-api/unicode.rst:446
msgid ":c:type:`size_t` or :c:type:`ssize_t`"
msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`"
#: ../../c-api/unicode.rst:448
msgid "``t``"
msgstr "``t``"
#: ../../c-api/unicode.rst:448
msgid ":c:type:`ptrdiff_t`"
msgstr ":c:type:`ptrdiff_t`"
#: ../../c-api/unicode.rst:451
msgid ""
"The length modifier ``l`` for following conversions ``s`` or ``V`` specify "
"that the type of the argument is :c:expr:`const wchar_t*`."
msgstr "针对以下转换 ``s`` 或 ``V`` 的长度修饰符 ``l`` 指明参数的类型为 :c:expr:`const wchar_t*`。"
#: ../../c-api/unicode.rst:454
msgid "The conversion specifiers are:"
msgstr "转换指示符如下:"
#: ../../c-api/unicode.rst:460
msgid "Conversion Specifier"
msgstr "转换指示符"
#: ../../c-api/unicode.rst:461
msgid "Type"
msgstr "类型"
#: ../../c-api/unicode.rst:462
msgid "Comment"
msgstr "注释"
#: ../../c-api/unicode.rst:464
msgid "``%``"
msgstr "``%``"
#: ../../c-api/unicode.rst:465
msgid "*n/a*"
msgstr "*不适用*"
#: ../../c-api/unicode.rst:466
msgid "The literal ``%`` character."
msgstr "字面的 ``%`` 字符。"
#: ../../c-api/unicode.rst:468
msgid "``d``, ``i``"
msgstr "``d``, ``i``"
#: ../../c-api/unicode.rst:469 ../../c-api/unicode.rst:473
#: ../../c-api/unicode.rst:477 ../../c-api/unicode.rst:481
#: ../../c-api/unicode.rst:485
msgid "Specified by the length modifier"
msgstr "由长度修饰符指明"
#: ../../c-api/unicode.rst:470
msgid "The decimal representation of a signed C integer."
msgstr "有符号 C 整数的十进制表示。"
#: ../../c-api/unicode.rst:472
msgid "``u``"
msgstr "``u``"
#: ../../c-api/unicode.rst:474
msgid "The decimal representation of an unsigned C integer."
msgstr "无符号 C 整数的十进制表示。"
#: ../../c-api/unicode.rst:476
msgid "``o``"
msgstr "``o``"
#: ../../c-api/unicode.rst:478
msgid "The octal representation of an unsigned C integer."
msgstr "无符号 C 整数的八进制表示。"
#: ../../c-api/unicode.rst:480
msgid "``x``"
msgstr "``x``"
#: ../../c-api/unicode.rst:482
msgid "The hexadecimal representation of an unsigned C integer (lowercase)."
msgstr "无符号 C 整数的十六进制表示(小写)。"
#: ../../c-api/unicode.rst:484
msgid "``X``"
msgstr "``X``"
#: ../../c-api/unicode.rst:486
msgid "The hexadecimal representation of an unsigned C integer (uppercase)."
msgstr "无符号 C 整数的十六进制表示(大写)。"
#: ../../c-api/unicode.rst:488
msgid "``c``"
msgstr "``c``"
#: ../../c-api/unicode.rst:489
msgid ":c:expr:`int`"
msgstr ":c:expr:`int`"
#: ../../c-api/unicode.rst:490
msgid "A single character."
msgstr "单个字符。"
#: ../../c-api/unicode.rst:492
msgid "``s``"
msgstr "``s``"
#: ../../c-api/unicode.rst:493
msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`"
msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`"
#: ../../c-api/unicode.rst:494
msgid "A null-terminated C character array."
msgstr "以 null 为终止符的 C 字符数组。"
#: ../../c-api/unicode.rst:496
msgid "``p``"
msgstr "``p``"
#: ../../c-api/unicode.rst:497
msgid ":c:expr:`const void*`"
msgstr ":c:expr:`const void*`"
#: ../../c-api/unicode.rst:498
msgid ""
"The hex representation of a C pointer. Mostly equivalent to "
"``printf(\"%p\")`` except that it is guaranteed to start with the literal "
"``0x`` regardless of what the platform's ``printf`` yields."
msgstr ""
"一个 C 指针的十六进制表示形式。 基本等价于 ``printf(\"%p\")`` 但它会确保以字面值 ``0x`` 开头而不管系统平台上的 "
"``printf`` 输出是什么。"
#: ../../c-api/unicode.rst:503
msgid "``A``"
msgstr "``A``"
#: ../../c-api/unicode.rst:504 ../../c-api/unicode.rst:508
#: ../../c-api/unicode.rst:518 ../../c-api/unicode.rst:522
msgid ":c:expr:`PyObject*`"
msgstr ":c:expr:`PyObject*`"
#: ../../c-api/unicode.rst:505
msgid "The result of calling :func:`ascii`."
msgstr ":func:`ascii` 调用的结果。"
#: ../../c-api/unicode.rst:507
msgid "``U``"
msgstr "``U``"
#: ../../c-api/unicode.rst:509
msgid "A Unicode object."
msgstr "一个 Unicode 对象。"
#: ../../c-api/unicode.rst:511
msgid "``V``"
msgstr "``V``"
#: ../../c-api/unicode.rst:512
msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`"
msgstr ":c:expr:`PyObject*`, :c:expr:`const char*` 或 :c:expr:`const wchar_t*`"
#: ../../c-api/unicode.rst:513
msgid ""
"A Unicode object (which may be ``NULL``) and a null-terminated C character "
"array as a second parameter (which will be used, if the first parameter is "
"``NULL``)."
msgstr ""
"一个 Unicode 对象 (可以为 ``NULL``) 和一个以空值结束的 C 字符数组作为第二个形参(如果第一个形参为 "
"``NULL``,第二个形参将被使用)。"
#: ../../c-api/unicode.rst:517
msgid "``S``"
msgstr "``S``"
#: ../../c-api/unicode.rst:519
msgid "The result of calling :c:func:`PyObject_Str`."
msgstr "调用 :c:func:`PyObject_Str` 的结果。"
#: ../../c-api/unicode.rst:521
msgid "``R``"
msgstr "``R``"
#: ../../c-api/unicode.rst:523
msgid "The result of calling :c:func:`PyObject_Repr`."
msgstr "调用 :c:func:`PyObject_Repr` 的结果。"
#: ../../c-api/unicode.rst:526
msgid ""
"The width formatter unit is number of characters rather than bytes. The "
"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if "
"the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the "
"``PyObject*`` argument is ``NULL``), and a number of characters for "
"``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the "
"``PyObject*`` argument is not ``NULL``)."
msgstr ""
"格式符的宽度单位是字符数而不是字节数。 格式符的精度单位对于 ``\"%s\"`` 和 ``\"%V\"`` (如果 ``PyObject*`` 参数为"
" ``NULL``) 是字节数或 :c:type:`wchar_t` 项数 (如果使用了长度修饰符 ``l``),而对于 ``\"%A\"``, "
"``\"%U\"``, ``\"%S\"``, ``\"%R\"`` 和 ``\"%V\"`` (如果 ``PyObject*`` 参数不为 "
"``NULL``) 则为字符数。"
#: ../../c-api/unicode.rst:534
msgid ""
"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision"
" is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or "
"``X``)."
msgstr ""
"与 C :c:func:`printf` 不同的是 ``0`` 旗标即使在为整数转换 (``d``, ``i``, ``u``, ``o``, "
"``x``, or ``X``) 指定精度时也是有效的。"
#: ../../c-api/unicode.rst:538
msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added."
msgstr "增加了对 ``\"%lld\"`` 和 ``\"%llu\"`` 的支持。"
#: ../../c-api/unicode.rst:541
msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added."
msgstr "增加了对 ``\"%li\"``, ``\"%lli\"`` 和 ``\"%zi\"`` 的支持。"
#: ../../c-api/unicode.rst:544
msgid ""
"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, "
"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added."
msgstr "增加了对 ``\"%s\"``, ``\"%A\"``, ``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` 的宽度和精度格式符支持。"
#: ../../c-api/unicode.rst:548
msgid ""
"Support for conversion specifiers ``o`` and ``X``. Support for length "
"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer "
"conversions. Length modifier ``l`` is now applied to conversion specifiers "
"``s`` and ``V``. Support for variable width and precision ``*``. Support for"
" flag ``-``."
msgstr ""
"支持转换说明符 ``o`` 和 ``X``。 支持长度修饰符 ``j`` 和 ``t``。 长度修饰符现在将应用于所有整数转换。 长度修饰符 ``l``"
" 现在将应用于转换说明符 ``s`` 和 ``V``。 支持可变宽度和精度 ``*``。 支持旗标 ``-``。"
#: ../../c-api/unicode.rst:556
msgid ""
"An unrecognized format character now sets a :exc:`SystemError`. In previous "
"versions it caused all the rest of the format string to be copied as-is to "
"the result string, and any extra arguments discarded."
msgstr ""
"不可识别的格式字符现在会设置一个 :exc:`SystemError`。 "
"在之前版本中它会导致所有剩余格式字符串被原样拷贝到结果字符串,并丢弃任何额外的参数。"
#: ../../c-api/unicode.rst:563
msgid ""
"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two"
" arguments."
msgstr "等同于 :c:func:`PyUnicode_FromFormat` 但它将接受恰好两个参数。"
#: ../../c-api/unicode.rst:569
msgid ""
"Copy an instance of a Unicode subtype to a new true Unicode object if "
"necessary. If *obj* is already a true Unicode object (not a subtype), return"
" a new :term:`strong reference` to the object."
msgstr ""
"如有必要将把一个 Unicode 子类型的实例拷贝为新的真实 Unicode 对象。 如果 *obj* 已经是一个真实 Unicode "
"对象(而非子类型),则返回一个新的指向该对象的 :term:`strong reference`。"
#: ../../c-api/unicode.rst:573
msgid ""
"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`."
msgstr "非 Unicode 或其子类型的对象将导致 :exc:`TypeError`。"
#: ../../c-api/unicode.rst:579
msgid "Decode an encoded object *obj* to a Unicode object."
msgstr "将一个已编码的对象 *obj* 解码为 Unicode 对象。"
#: ../../c-api/unicode.rst:581
msgid ""
":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects "
"<bytes-like object>` are decoded according to the given *encoding* and using"
" the error handling defined by *errors*. Both can be ``NULL`` to have the "
"interface use the default values (see :ref:`builtincodecs` for details)."
msgstr ""
":class:`bytes`, :class:`bytearray` 和其他 :term:`字节类对象 <bytes-like object>` "
"将按照给定的 *encoding* 来解码并使用由 *errors* 定义的错误处理方式。 两者均可为 ``NULL`` 即让接口使用默认值(请参阅 "
":ref:`builtincodecs` 了解详情)。"
#: ../../c-api/unicode.rst:587
msgid ""
"All other objects, including Unicode objects, cause a :exc:`TypeError` to be"
" set."
msgstr "所有其他对象,包括 Unicode 对象,都将导致设置 :exc:`TypeError`。"
#: ../../c-api/unicode.rst:590
msgid ""
"The API returns ``NULL`` if there was an error. The caller is responsible "
"for decref'ing the returned objects."
msgstr "如有错误该 API 将返回 ``NULL``。 调用方要负责递减指向所返回对象的引用。"
#: ../../c-api/unicode.rst:596
msgid ""
"Return the name of the default string encoding, ``\"utf-8\"``. See "
":func:`sys.getdefaultencoding`."
msgstr "返回默认字符编码格式名称,即 ``\"utf-8\"``。 参见 :func:`sys.getdefaultencoding`。"
#: ../../c-api/unicode.rst:599
msgid ""
"The returned string does not need to be freed, and is valid until "
"interpreter shutdown."
msgstr "返回的字符串不需要被释放,并将保持可用直到解释器关闭。"
#: ../../c-api/unicode.rst:605
msgid "Return the length of the Unicode object, in code points."
msgstr "返回 Unicode 对象码位的长度。"
#: ../../c-api/unicode.rst:607
msgid "On error, set an exception and return ``-1``."
msgstr "发生错误时,将设置异常并返回 ``-1``。"
#: ../../c-api/unicode.rst:618
msgid ""
"Copy characters from one Unicode object into another. This function "
"performs character conversion when necessary and falls back to "
":c:func:`!memcpy` if possible. Returns ``-1`` and sets an exception on "
"error, otherwise returns the number of copied characters."
msgstr ""
"将一个 Unicode 对象中的字符拷贝到另一个对象中。 此函数会在必要时执行字符转换并会在可能的情况下回退到 :c:func:`!memcpy`。 "
"在出错时将返回 ``-1`` 并设置一个异常,在其他情况下将返回拷贝的字符数量。"
#: ../../c-api/unicode.rst:629
msgid ""
"Fill a string with a character: write *fill_char* into "
"``unicode[start:start+length]``."
msgstr "使用一个字符填充字符串:将 *fill_char* 写入 ``unicode[start:start+length]``。"
#: ../../c-api/unicode.rst:632
msgid ""
"Fail if *fill_char* is bigger than the string maximum character, or if the "
"string has more than 1 reference."
msgstr "如果 *fill_char* 值大于字符串最大字符值,或者如果字符串有 1 以上的引用将执行失败。"
#: ../../c-api/unicode.rst:635
msgid ""
"Return the number of written character, or return ``-1`` and raise an "
"exception on error."
msgstr "返回写入的字符数量,或者在出错时返回 ``-1`` 并引发一个异常。"
#: ../../c-api/unicode.rst:644
msgid ""
"Write a character to a string. The string must have been created through "
":c:func:`PyUnicode_New`. Since Unicode strings are supposed to be "
"immutable, the string must not be shared, or have been hashed yet."
msgstr ""
"将一个字符写入到字符串。 字符串必须通过 :c:func:`PyUnicode_New` 创建。 由于 Unicode "
"字符串应当是不可变的,因此该字符串不能被共享,或是被哈希。"
#: ../../c-api/unicode.rst:648
msgid ""
"This function checks that *unicode* is a Unicode object, that the index is "
"not out of bounds, and that the object can be modified safely (i.e. that it "
"its reference count is one)."
msgstr "该函数将检查 *unicode* 是否为 Unicode 对象,索引是否未越界,并且对象是否可被安全地修改(即其引用计数为一)。"
#: ../../c-api/unicode.rst:652
msgid "Return ``0`` on success, ``-1`` on error with an exception set."
msgstr "成功时返回 ``0``,出错时返回 ``-1`` 并设置一个异常。"
#: ../../c-api/unicode.rst:659
msgid ""
"Read a character from a string. This function checks that *unicode* is a "
"Unicode object and the index is not out of bounds, in contrast to "
":c:func:`PyUnicode_READ_CHAR`, which performs no error checking."
msgstr ""
"从字符串读取一个字符。 该函数将检查 *unicode* 是否为 Unicode 对象且索引是否未越界,这不同于 "
":c:func:`PyUnicode_READ_CHAR`,后者不会执行任何错误检查。"
#: ../../c-api/unicode.rst:663
msgid "Return character on success, ``-1`` on error with an exception set."
msgstr "成功时返回字符,出错时返回 ``-1`` 并设置一个异常。"
#: ../../c-api/unicode.rst:671
msgid ""
"Return a substring of *unicode*, from character index *start* (included) to "
"character index *end* (excluded). Negative indices are not supported. On "
"error, set an exception and return ``NULL``."
msgstr ""
"返回 *unicode* 的一个子串,从字符索引 *start* (含) 到字符索引 *end* (不含)。 不支持负索引号。 "
"出错时,将设置一个异常并返回 ``NULL``。"
#: ../../c-api/unicode.rst:681
msgid ""
"Copy the string *unicode* into a UCS4 buffer, including a null character, if"
" *copy_null* is set. Returns ``NULL`` and sets an exception on error (in "
"particular, a :exc:`SystemError` if *buflen* is smaller than the length of "
"*unicode*). *buffer* is returned on success."
msgstr ""
"将字符串 *unicode* 拷贝到一个 UCS4 缓冲区,包括一个空字符,如果设置了 *copy_null* 的话。 出错时返回 ``NULL`` "
"并设置一个异常(特别是当 *buflen* 小于 *unicode* 的长度时,将设置 :exc:`SystemError` 异常)。 成功时返回 "
"*buffer*。"
#: ../../c-api/unicode.rst:691
msgid ""
"Copy the string *unicode* into a new UCS4 buffer that is allocated using "
":c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a "
":exc:`MemoryError` set. The returned buffer always has an extra null code "
"point appended."
msgstr ""
"将字符串 *unicode* 拷贝到使用 :c:func:`PyMem_Malloc` 分配的新 UCS4 缓冲区。 如果执行失败,将返回 "
"``NULL`` 并设置 :exc:`MemoryError`。 返回的缓冲区将总是会添加一个额外的空码位。"
#: ../../c-api/unicode.rst:700
msgid "Locale Encoding"
msgstr "语言区域编码格式"
#: ../../c-api/unicode.rst:702
msgid ""
"The current locale encoding can be used to decode text from the operating "
"system."
msgstr "当前语言区域编码格式可被用来解码来自操作系统的文本。"
#: ../../c-api/unicode.rst:709
msgid ""
"Decode a string from UTF-8 on Android and VxWorks, or from the current "
"locale encoding on other platforms. The supported error handlers are "
"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses "
"``\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a"
" null character but cannot contain embedded null characters."
msgstr ""
"解码字符串在 Android 和 VxWorks 上使用 UTF-8,在其他平台上则使用当前语言区域编码格式。 支持的错误处理器有 "
"``\"strict\"`` 和 ``\"surrogateescape\"`` (:pep:`383`)。 如果 *errors* 为 "
"``NULL`` 则解码器将使用 ``\"strict\"`` 错误处理器。 *str* 必须以一个空字符结束但不可包含嵌入的空字符。"
#: ../../c-api/unicode.rst:716
msgid ""
"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the "
":term:`filesystem encoding and error handler`."
msgstr ""
"使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize` 以 :term:`filesystem encoding "
"and error handler` 来解码字符串。"
#: ../../c-api/unicode.rst:719 ../../c-api/unicode.rst:754