Commit 54de2b1e authored by Victor Stinner's avatar Victor Stinner

Fix check_force_ascii()

Issue #27938: Normalize aliases of the ASCII encoding, because
_Py_normalize_encoding() now correctly normalize encoding names.
parent 11ea0449
...@@ -104,23 +104,24 @@ check_force_ascii(void) ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment