mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separator
* Decode thousands separator and decimal point using PyUnicode_DecodeLocale() (from the locale encoding), instead of decoding them implicitly from latin1 * Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used * Change _PyUnicode_InsertThousandsGrouping() API to return the maximum character if unicode is NULL * Replace MIN/MAX macros by Py_MIN/Py_MAX * stringlib/undef.h undefines STRINGLIB_IS_UNICODE * stringlib/localeutil.h only supports Unicode
This commit is contained in:
parent
dcb30cf959
commit
41a863cb81
12 changed files with 187 additions and 150 deletions
|
@ -1936,32 +1936,20 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
|
|||
);
|
||||
#endif
|
||||
|
||||
/* Using the current locale, insert the thousands grouping
|
||||
into the string pointed to by buffer. For the argument descriptions,
|
||||
see Objects/stringlib/localeutil.h */
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGroupingLocale(Py_UNICODE *buffer,
|
||||
Py_ssize_t n_buffer,
|
||||
Py_UNICODE *digits,
|
||||
Py_ssize_t n_digits,
|
||||
Py_ssize_t min_width);
|
||||
#endif
|
||||
|
||||
/* Using explicit passed-in values, insert the thousands grouping
|
||||
into the string pointed to by buffer. For the argument descriptions,
|
||||
see Objects/stringlib/localeutil.h */
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(
|
||||
PyObject *unicode,
|
||||
int kind,
|
||||
void *buffer,
|
||||
Py_ssize_t index,
|
||||
Py_ssize_t n_buffer,
|
||||
void *digits,
|
||||
Py_ssize_t n_digits,
|
||||
Py_ssize_t min_width,
|
||||
const char *grouping,
|
||||
const char *thousands_sep);
|
||||
PyObject *thousands_sep,
|
||||
Py_UCS4 *maxchar);
|
||||
#endif
|
||||
/* === Characters Type APIs =============================================== */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue