mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +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; | ||||
| #if defined(HAVE_LANGINFO_H) && defined(CODESET) | ||||
|     char *codeset, **alias; | ||||
|     char encoding[100]; | ||||
|     char encoding[20];   /* longest name: "iso_646.irv_1991\0" */ | ||||
|     int is_ascii; | ||||
|     unsigned int i; | ||||
|     char* ascii_aliases[] = { | ||||
|         "ascii", | ||||
|         /* Aliases from Lib/encodings/aliases.py */ | ||||
|         "646", | ||||
|         "ansi-x3.4-1968", | ||||
|         "ansi-x3-4-1968", | ||||
|         "ansi-x3.4-1986", | ||||
|         "ansi_x3.4_1968", | ||||
|         "ansi_x3.4_1986", | ||||
|         "ansi_x3_4_1968", | ||||
|         "cp367", | ||||
|         "csascii", | ||||
|         "ibm367", | ||||
|         "iso646-us", | ||||
|         "iso-646.irv-1991", | ||||
|         "iso-ir-6", | ||||
|         "iso646_us", | ||||
|         "iso_646.irv_1991", | ||||
|         "iso_ir_6", | ||||
|         "us", | ||||
|         "us-ascii", | ||||
|         "us_ascii", | ||||
|         NULL | ||||
|     }; | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner