summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Modules/cjkcodecs
diff options
context:
space:
mode:
authorshadchin <[email protected]>2023-12-13 02:43:57 +0300
committershadchin <[email protected]>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib/tools/python3/src/Modules/cjkcodecs
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib/tools/python3/src/Modules/cjkcodecs')
-rw-r--r--contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c b/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
index 7394cf67e0e..6d906ecdd39 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
+++ b/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
@@ -181,8 +181,9 @@ ENCODER(iso2022)
encoded = MAP_UNMAPPABLE;
for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
+ Py_UCS4 buf[2] = {c, 0};
Py_ssize_t length = 1;
- encoded = dsg->encoder(&c, &length);
+ encoded = dsg->encoder(buf, &length);
if (encoded == MAP_MULTIPLE_AVAIL) {
/* this implementation won't work for pair
* of non-bmp characters. */
@@ -191,9 +192,11 @@ ENCODER(iso2022)
return MBERR_TOOFEW;
length = -1;
}
- else
+ else {
+ buf[1] = INCHAR2;
length = 2;
- encoded = dsg->encoder(&c, &length);
+ }
+ encoded = dsg->encoder(buf, &length);
if (encoded != MAP_UNMAPPABLE) {
insize = length;
break;