UTF-32 by definition can't handle characters higher than 0x10FFFF

This commit is contained in:
Sam Lantinga
2006-03-13 01:16:16 +00:00
parent 48c546dc44
commit 992d5b4402
2 changed files with 7 additions and 5 deletions

View File

@@ -669,7 +669,7 @@ size_t SDL_iconv(SDL_iconv_t cd,
case ENCODING_UTF32BE:
{
Uint8 *p = (Uint8 *)dst;
if ( ch > 0x7FFFFFFF ) {
if ( ch > 0x10FFFF ) {
ch = UNKNOWN_UNICODE;
}
if ( dstlen < 4 ) {
@@ -686,7 +686,7 @@ size_t SDL_iconv(SDL_iconv_t cd,
case ENCODING_UTF32LE:
{
Uint8 *p = (Uint8 *)dst;
if ( ch > 0x7FFFFFFF ) {
if ( ch > 0x10FFFF ) {
ch = UNKNOWN_UNICODE;
}
if ( dstlen < 4 ) {