LEFT | RIGHT |
1 .. highlightlang:: c | 1 .. highlightlang:: c |
2 | 2 |
3 .. _unicodeobjects: | 3 .. _unicodeobjects: |
4 | 4 |
5 Unicode Objects and Codecs | 5 Unicode Objects and Codecs |
6 -------------------------- | 6 -------------------------- |
7 | 7 |
8 .. sectionauthor:: Marc-Andre Lemburg <mal@lemburg.com> | 8 .. sectionauthor:: Marc-Andre Lemburg <mal@lemburg.com> |
9 | 9 |
10 Unicode Objects | 10 Unicode Objects |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 Return 1 or 0 depending on whether *ch* is an alphabetic character. | 140 Return 1 or 0 depending on whether *ch* is an alphabetic character. |
141 | 141 |
142 | 142 |
143 .. cfunction:: int Py_UNICODE_ISALNUM(Py_UNICODE ch) | 143 .. cfunction:: int Py_UNICODE_ISALNUM(Py_UNICODE ch) |
144 | 144 |
145 Return 1 or 0 depending on whether *ch* is an alphanumeric character. | 145 Return 1 or 0 depending on whether *ch* is an alphanumeric character. |
146 | 146 |
147 .. cfunction:: int Py_UNICODE_ISPRINTABLE(Py_UNICODE ch) | 147 .. cfunction:: int Py_UNICODE_ISPRINTABLE(Py_UNICODE ch) |
148 | 148 |
149 Return 1 or 0 depending on whether *ch* is a printable character. | 149 Return 1 or 0 depending on whether *ch* is a printable character. |
150 Characters defined in the Unicode character database as "Other" | 150 All character except those characters defined in the Unicode character |
151 or "Separator" other than ASCII space(0x20) are not considered | 151 database as "Other" or "Separator" other than ASCII space(0x20) are· |
152 printable. | 152 considered printable. |
153 | 153 |
154 These APIs can be used for fast direct character conversions: | 154 These APIs can be used for fast direct character conversions: |
155 | 155 |
156 | 156 |
157 .. cfunction:: Py_UNICODE Py_UNICODE_TOLOWER(Py_UNICODE ch) | 157 .. cfunction:: Py_UNICODE Py_UNICODE_TOLOWER(Py_UNICODE ch) |
158 | 158 |
159 Return the character *ch* converted to lower case. | 159 Return the character *ch* converted to lower case. |
160 | 160 |
161 | 161 |
162 .. cfunction:: Py_UNICODE Py_UNICODE_TOUPPER(Py_UNICODE ch) | 162 .. cfunction:: Py_UNICODE Py_UNICODE_TOUPPER(Py_UNICODE ch) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 string. The following format characters are allowed: | 227 string. The following format characters are allowed: |
228 | 228 |
229 .. % The descriptions for %zd and %zu are wrong, but the truth is complicated | 229 .. % The descriptions for %zd and %zu are wrong, but the truth is complicated |
230 .. % because not all compilers support the %z width modifier -- we fake it | 230 .. % because not all compilers support the %z width modifier -- we fake it |
231 .. % when necessary via interpolating PY_FORMAT_SIZE_T. | 231 .. % when necessary via interpolating PY_FORMAT_SIZE_T. |
232 | 232 |
233 +-------------------+---------------------+--------------------------------+ | 233 +-------------------+---------------------+--------------------------------+ |
234 | Format Characters | Type | Comment | | 234 | Format Characters | Type | Comment | |
235 +===================+=====================+================================+ | 235 +===================+=====================+================================+ |
236 | :attr:`%%` | *n/a* | The literal % character. | | 236 | :attr:`%%` | *n/a* | The literal % character. | |
237 +-------------------+---------------------+--------------------------------+ | |
238 | :attr:`%a` | PyObject\* | The result of calling | | |
239 | | | :func:`ascii`. | | |
240 +-------------------+---------------------+--------------------------------+ | 237 +-------------------+---------------------+--------------------------------+ |
241 | :attr:`%c` | int | A single character, | | 238 | :attr:`%c` | int | A single character, | |
242 | | | represented as an C int. | | 239 | | | represented as an C int. | |
243 +-------------------+---------------------+--------------------------------+ | 240 +-------------------+---------------------+--------------------------------+ |
244 | :attr:`%d` | int | Exactly equivalent to | | 241 | :attr:`%d` | int | Exactly equivalent to | |
245 | | | ``printf("%d")``. | | 242 | | | ``printf("%d")``. | |
246 +-------------------+---------------------+--------------------------------+ | 243 +-------------------+---------------------+--------------------------------+ |
247 | :attr:`%u` | unsigned int | Exactly equivalent to | | 244 | :attr:`%u` | unsigned int | Exactly equivalent to | |
248 | | | ``printf("%u")``. | | 245 | | | ``printf("%u")``. | |
249 +-------------------+---------------------+--------------------------------+ | 246 +-------------------+---------------------+--------------------------------+ |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 if and only if you owned it before the call.) | 908 if and only if you owned it before the call.) |
912 | 909 |
913 | 910 |
914 .. cfunction:: PyObject* PyUnicode_InternFromString(const char *v) | 911 .. cfunction:: PyObject* PyUnicode_InternFromString(const char *v) |
915 | 912 |
916 A combination of :cfunc:`PyUnicode_FromString` and | 913 A combination of :cfunc:`PyUnicode_FromString` and |
917 :cfunc:`PyUnicode_InternInPlace`, returning either a new unicode string objec
t | 914 :cfunc:`PyUnicode_InternInPlace`, returning either a new unicode string objec
t |
918 that has been interned, or a new ("owned") reference to an earlier interned | 915 that has been interned, or a new ("owned") reference to an earlier interned |
919 string object with the same value. | 916 string object with the same value. |
920 | 917 |
LEFT | RIGHT |