mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-124476: Fix decoding from the locale encoding in the C.UTF-8 locale (GH-132477)
This commit is contained in:
parent
61638418a7
commit
102f825c51
2 changed files with 2 additions and 9 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fix decoding from the locale encoding in the C.UTF-8 locale.
|
||||||
|
|
@ -528,15 +528,7 @@ decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (converted == INCOMPLETE_CHARACTER) {
|
if (converted == DECODE_ERROR || converted == INCOMPLETE_CHARACTER) {
|
||||||
/* Incomplete character. This should never happen,
|
|
||||||
since we provide everything that we have -
|
|
||||||
unless there is a bug in the C library, or I
|
|
||||||
misunderstood how mbrtowc works. */
|
|
||||||
goto decode_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (converted == DECODE_ERROR) {
|
|
||||||
if (!surrogateescape) {
|
if (!surrogateescape) {
|
||||||
goto decode_error;
|
goto decode_error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue