From 0cf12b5e3a90f37457233ba99dbb64777e701e3b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 13 Mar 2006 17:25:44 +0000 Subject: [PATCH] RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF (the UTF-16 accessible range) --- src/stdlib/SDL_iconv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index b752e1275..680a3f297 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -368,7 +368,8 @@ size_t SDL_iconv(SDL_iconv_t cd, ch = UNKNOWN_UNICODE; } if ( (ch >= 0xD800 && ch <= 0xDFFF) || - (ch == 0xFFFE || ch == 0xFFFF) ) { + (ch == 0xFFFE || ch == 0xFFFF) || + ch > 0x10FFFF ) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ @@ -545,7 +546,7 @@ size_t SDL_iconv(SDL_iconv_t cd, case ENCODING_UTF8: /* RFC 3629 */ { Uint8 *p = (Uint8 *)dst; - if ( ch > 0x7FFFFFFF ) { + if ( ch > 0x10FFFF ) { ch = UNKNOWN_UNICODE; } if ( ch <= 0x7F ) {