mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #10557: Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
This commit is contained in:
parent
36526bf3d9
commit
942af5a9a4
11 changed files with 169 additions and 52 deletions
|
@ -1225,6 +1225,17 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
|
|||
);
|
||||
#endif
|
||||
|
||||
/* Transforms code points that have decimal digit property to the
|
||||
corresponding ASCII digit code points.
|
||||
|
||||
Returns a new Unicode string on success, NULL on failure.
|
||||
*/
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII(
|
||||
Py_UNICODE *s, /* Unicode buffer */
|
||||
Py_ssize_t length /* Number of Py_UNICODE chars to transform */
|
||||
);
|
||||
|
||||
/* --- File system encoding ---------------------------------------------- */
|
||||
|
||||
/* ParseTuple converter: encode str objects to bytes using
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue