src/stdlib/SDL_iconv.c
changeset 1519 c99e7a9c9bc9
parent 1513 13a3520a13f9
child 1662 782fd950bd46
child 1849 b5a4ac87b98c
equal deleted inserted replaced
1518:4d711949cd9a 1519:c99e7a9c9bc9
   366 					return SDL_ICONV_EILSEQ;
   366 					return SDL_ICONV_EILSEQ;
   367 					*/
   367 					*/
   368 					ch = UNKNOWN_UNICODE;
   368 					ch = UNKNOWN_UNICODE;
   369 				}
   369 				}
   370 				if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
   370 				if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
   371 				     (ch == 0xFFFE || ch == 0xFFFF) ) {
   371 				     (ch == 0xFFFE || ch == 0xFFFF) ||
       
   372 				     ch > 0x10FFFF ) {
   372 					/* Skip illegal sequences
   373 					/* Skip illegal sequences
   373 					return SDL_ICONV_EILSEQ;
   374 					return SDL_ICONV_EILSEQ;
   374 					*/
   375 					*/
   375 					ch = UNKNOWN_UNICODE;
   376 					ch = UNKNOWN_UNICODE;
   376 				}
   377 				}
   543 			}
   544 			}
   544 			break;
   545 			break;
   545 		    case ENCODING_UTF8: /* RFC 3629 */
   546 		    case ENCODING_UTF8: /* RFC 3629 */
   546 			{
   547 			{
   547 				Uint8 *p = (Uint8 *)dst;
   548 				Uint8 *p = (Uint8 *)dst;
   548 				if ( ch > 0x7FFFFFFF ) {
   549 				if ( ch > 0x10FFFF ) {
   549 					ch = UNKNOWN_UNICODE;
   550 					ch = UNKNOWN_UNICODE;
   550 				}
   551 				}
   551 				if ( ch <= 0x7F ) {
   552 				if ( ch <= 0x7F ) {
   552 					if ( dstlen < 1 ) {
   553 					if ( dstlen < 1 ) {
   553 						return SDL_ICONV_E2BIG;
   554 						return SDL_ICONV_E2BIG;