mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix check_force_ascii()
Issue #27938: Normalize aliases of the ASCII encoding, because _Py_normalize_encoding() now correctly normalize encoding names.
This commit is contained in:
parent
11ea04491d
commit
54de2b1edd
1 changed files with 9 additions and 8 deletions
|
@ -104,23 +104,24 @@ check_force_ascii(void)
|
||||||
char *loc;
|
char *loc;
|
||||||
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
|
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
|
||||||
char *codeset, **alias;
|
char *codeset, **alias;
|
||||||
char encoding[100];
|
char encoding[20]; /* longest name: "iso_646.irv_1991\0" */
|
||||||
int is_ascii;
|
int is_ascii;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
char* ascii_aliases[] = {
|
char* ascii_aliases[] = {
|
||||||
"ascii",
|
"ascii",
|
||||||
|
/* Aliases from Lib/encodings/aliases.py */
|
||||||
"646",
|
"646",
|
||||||
"ansi-x3.4-1968",
|
"ansi_x3.4_1968",
|
||||||
"ansi-x3-4-1968",
|
"ansi_x3.4_1986",
|
||||||
"ansi-x3.4-1986",
|
"ansi_x3_4_1968",
|
||||||
"cp367",
|
"cp367",
|
||||||
"csascii",
|
"csascii",
|
||||||
"ibm367",
|
"ibm367",
|
||||||
"iso646-us",
|
"iso646_us",
|
||||||
"iso-646.irv-1991",
|
"iso_646.irv_1991",
|
||||||
"iso-ir-6",
|
"iso_ir_6",
|
||||||
"us",
|
"us",
|
||||||
"us-ascii",
|
"us_ascii",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue