RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF (the UTF-16 accessible range)
authorSam Lantinga <slouken@libsdl.org>
Mon, 13 Mar 2006 17:25:44 +0000
changeset 1519c99e7a9c9bc9
parent 1518 4d711949cd9a
child 1520 5d264facfd03
RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF (the UTF-16 accessible range)
src/stdlib/SDL_iconv.c
     1.1 --- a/src/stdlib/SDL_iconv.c	Mon Mar 13 16:56:01 2006 +0000
     1.2 +++ b/src/stdlib/SDL_iconv.c	Mon Mar 13 17:25:44 2006 +0000
     1.3 @@ -368,7 +368,8 @@
     1.4  					ch = UNKNOWN_UNICODE;
     1.5  				}
     1.6  				if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
     1.7 -				     (ch == 0xFFFE || ch == 0xFFFF) ) {
     1.8 +				     (ch == 0xFFFE || ch == 0xFFFF) ||
     1.9 +				     ch > 0x10FFFF ) {
    1.10  					/* Skip illegal sequences
    1.11  					return SDL_ICONV_EILSEQ;
    1.12  					*/
    1.13 @@ -545,7 +546,7 @@
    1.14  		    case ENCODING_UTF8: /* RFC 3629 */
    1.15  			{
    1.16  				Uint8 *p = (Uint8 *)dst;
    1.17 -				if ( ch > 0x7FFFFFFF ) {
    1.18 +				if ( ch > 0x10FFFF ) {
    1.19  					ch = UNKNOWN_UNICODE;
    1.20  				}
    1.21  				if ( ch <= 0x7F ) {