Commit 7056c5dc authored by Sam Lantinga's avatar Sam Lantinga

RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF...

RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF (the UTF-16 accessible range)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401523
parent de88144c
...@@ -368,7 +368,8 @@ size_t SDL_iconv(SDL_iconv_t cd, ...@@ -368,7 +368,8 @@ size_t SDL_iconv(SDL_iconv_t cd,
ch = UNKNOWN_UNICODE; ch = UNKNOWN_UNICODE;
} }
if ( (ch >= 0xD800 && ch <= 0xDFFF) || if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
(ch == 0xFFFE || ch == 0xFFFF) ) { (ch == 0xFFFE || ch == 0xFFFF) ||
ch > 0x10FFFF ) {
/* Skip illegal sequences /* Skip illegal sequences
return SDL_ICONV_EILSEQ; return SDL_ICONV_EILSEQ;
*/ */
...@@ -545,7 +546,7 @@ size_t SDL_iconv(SDL_iconv_t cd, ...@@ -545,7 +546,7 @@ size_t SDL_iconv(SDL_iconv_t cd,
case ENCODING_UTF8: /* RFC 3629 */ case ENCODING_UTF8: /* RFC 3629 */
{ {
Uint8 *p = (Uint8 *)dst; Uint8 *p = (Uint8 *)dst;
if ( ch > 0x7FFFFFFF ) { if ( ch > 0x10FFFF ) {
ch = UNKNOWN_UNICODE; ch = UNKNOWN_UNICODE;
} }
if ( ch <= 0x7F ) { if ( ch <= 0x7F ) {
......
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