bpo-36549: str.capitalize now titlecases the first character instead of uppercasing it (GH-12804)

This commit is contained in:
Kingsley M 2019-04-12 16:35:39 +01:00 committed by Steve Dower
parent f13c5c8b94
commit b015fc86f7
5 changed files with 10 additions and 5 deletions

View file

@ -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];