mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-36549: str.capitalize now titlecases the first character instead of uppercasing it (GH-12804)
This commit is contained in:
parent
f13c5c8b94
commit
b015fc86f7
5 changed files with 10 additions and 5 deletions
|
@ -9675,7 +9675,7 @@ do_capitalize(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *ma
|
|||
Py_UCS4 c, mapped[3];
|
||||
|
||||
c = PyUnicode_READ(kind, data, 0);
|
||||
n_res = _PyUnicode_ToUpperFull(c, mapped);
|
||||
n_res = _PyUnicode_ToTitleFull(c, mapped);
|
||||
for (j = 0; j < n_res; j++) {
|
||||
*maxchar = Py_MAX(*maxchar, mapped[j]);
|
||||
res[k++] = mapped[j];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue