mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Test UTF-32LE before UTF-16LE since UTF-16LE BOM is a prefix of UTF-32LE BOM.
This commit is contained in:
		
							parent
							
								
									e0cb9da9d6
								
							
						
					
					
						commit
						29e2aa696d
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -965,10 +965,12 @@ typedef struct {
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static BOM BOMs[] = {
 | 
					static BOM BOMs[] = {
 | 
				
			||||||
    { 3, { 0xEF, 0xBB, 0xBF }, CP_UTF8 },           /* UTF-8 - keep first */
 | 
					    { 3, { 0xEF, 0xBB, 0xBF }, CP_UTF8 },           /* UTF-8 - keep first */
 | 
				
			||||||
    { 2, { 0xFF, 0xFE }, CP_UTF16LE },              /* UTF-16LE */
 | 
					    /* Test UTF-32LE before UTF-16LE since UTF-16LE BOM is a prefix
 | 
				
			||||||
    { 2, { 0xFE, 0xFF }, CP_UTF16BE },              /* UTF-16BE */
 | 
					     * of UTF-32LE BOM. */
 | 
				
			||||||
    { 4, { 0xFF, 0xFE, 0x00, 0x00 }, CP_UTF32LE },  /* UTF-32LE */
 | 
					    { 4, { 0xFF, 0xFE, 0x00, 0x00 }, CP_UTF32LE },  /* UTF-32LE */
 | 
				
			||||||
    { 4, { 0x00, 0x00, 0xFE, 0xFF }, CP_UTF32BE },  /* UTF-32BE */
 | 
					    { 4, { 0x00, 0x00, 0xFE, 0xFF }, CP_UTF32BE },  /* UTF-32BE */
 | 
				
			||||||
 | 
					    { 2, { 0xFF, 0xFE }, CP_UTF16LE },              /* UTF-16LE */
 | 
				
			||||||
 | 
					    { 2, { 0xFE, 0xFF }, CP_UTF16BE },              /* UTF-16BE */
 | 
				
			||||||
    { 0 }                                           /* sentinel */
 | 
					    { 0 }                                           /* sentinel */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue