Skip to content

Commit

Permalink
RFC 3629 restricted the range of characters encoded with UTF-8 to 000…
Browse files Browse the repository at this point in the history
…0-10FFFF (the UTF-16 accessible range)
  • Loading branch information
slouken committed Mar 13, 2006
1 parent 2b36a23 commit 0cf12b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stdlib/SDL_iconv.c
Expand Up @@ -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;
*/
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 0cf12b5

Please sign in to comment.