![]() ![]() Next argument, which must be of type int, and the object toĬonvert comes after the minimum field width and optional precision. If specified as an '*' (asterisk), the actual width is given in the The '%' character, which marks the start of the specifier.Ĭonversion flags (optional), which affect the result of some conversion Types and must correspond exactly to the format characters in the formatĪ conversion specifier contains two or more characters and has the followingĬomponents, which must occur in this order: Take a C printf()-style format string and a variable number ofĪrguments, calculate the size of the resulting Python Unicode string and returnĪ string with the values formatted into it. PyObject * PyUnicode_FromFormat ( const char * format. Part of the Stable ABI.Ĭreate a Unicode object from a UTF-8 encoded null-terminated char buffer PyObject * PyUnicode_FromString ( const char * u ) ¶ ObjectsĬreated using this function are not resizable.ģ.12 sürümünde değişti: u = NULL with size > 0 is not allowed anymore. This is the recommended way to allocate a new Unicode object. As an approximation, it can be rounded up to the maxchar should be the true maximum code point To create Unicode objects and access their basic sequence properties, use theseĪPIs: PyObject * PyUnicode_New ( Py_ssize_t size, Py_UCS4 maxchar ) ¶Ĭreate a new Unicode object. high must be in the range and low mustīe in the range. High and low are respectively the leading and trailing surrogates in a Join two surrogate characters and return a single Py_UCS4 value. Py_UCS4 Py_UNICODE_JOIN_SURROGATES ( Py_UCS4 high, Py_UCS4 low ) ¶ int Py_UNICODE_IS_LOW_SURROGATE ( Py_UCS4 ch ) ¶Ĭheck if ch is a low surrogate ( 0xDC00 <= ch <= 0xDFFF). ![]() int Py_UNICODE_IS_HIGH_SURROGATE ( Py_UCS4 ch ) ¶Ĭheck if ch is a high surrogate ( 0xD800 <= ch <= 0xDBFF). These APIs can be used to work with surrogates: int Py_UNICODE_IS_SURROGATE ( Py_UCS4 ch ) ¶Ĭheck if ch is a surrogate ( 0xD800 <= ch <= 0xDFFF). Return the character ch converted to a double. double Py_UNICODE_TONUMERIC ( Py_UCS4 ch ) ¶ Return the character ch converted to a single digit integer. Return the character ch converted to a decimal positive integer. int Py_UNICODE_TODECIMAL ( Py_UCS4 ch ) ¶ Return the character ch converted to title case. Py_UCS4 Py_UNICODE_TOTITLE ( Py_UCS4 ch ) ¶ Return the character ch converted to upper case. Py_UCS4 Py_UNICODE_TOUPPER ( Py_UCS4 ch ) ¶ Return the character ch converted to lower case. These APIs can be used for fast direct character conversions: Py_UCS4 Py_UNICODE_TOLOWER ( Py_UCS4 ch ) ¶ It has no bearing on the handling of strings written to sys.stdout or ![]() Those which should not be escaped when repr() is invoked on a string. (Note that printable characters in this context are Nonprintable characters are those characters defined in the Unicode characterĭatabase as “Other” or “Separator”, excepting the ASCII space (0x20) which isĬonsidered printable. Return 1 or 0 depending on whether ch is a printable character. int Py_UNICODE_ISPRINTABLE ( Py_UCS4 ch ) ¶ Return 1 or 0 depending on whether ch is an alphanumeric character. Return 1 or 0 depending on whether ch is an alphabetic character. Return 1 or 0 depending on whether ch is a numeric character. int Py_UNICODE_ISNUMERIC ( Py_UCS4 ch ) ¶ Return 1 or 0 depending on whether ch is a digit character. Return 1 or 0 depending on whether ch is a decimal character. int Py_UNICODE_ISDECIMAL ( Py_UCS4 ch ) ¶ Return 1 or 0 depending on whether ch is a linebreak character. int Py_UNICODE_ISLINEBREAK ( Py_UCS4 ch ) ¶ Return 1 or 0 depending on whether ch is a titlecase character. Return 1 or 0 depending on whether ch is an uppercase character. ![]() Return 1 or 0 depending on whether ch is a lowercase character. Return 1 or 0 depending on whether ch is a whitespace character. The most often needed onesĪre available through these macros which are mapped to C functions depending on Unicode provides many different character properties. 3.9 sürümünde değişti: The function does not call Py_FatalError() anymore if the string ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |