The check for UTF-* isn't needed anymore since UTF-8 has the same code range.
authorSam Lantinga <slouken@libsdl.org>
Tue, 14 Mar 2006 07:45:15 +0000
changeset 1528ff3322d66771
parent 1527 ce84e28c2c07
child 1529 84cecd0b64b4
The check for UTF-* isn't needed anymore since UTF-8 has the same code range.
test/testiconv.c
     1.1 --- a/test/testiconv.c	Tue Mar 14 07:40:33 2006 +0000
     1.2 +++ b/test/testiconv.c	Tue Mar 14 07:45:15 2006 +0000
     1.3 @@ -3,18 +3,6 @@
     1.4  
     1.5  #include "SDL.h"
     1.6  
     1.7 -static SDL_bool testutf1632(char *data)
     1.8 -{
     1.9 -	Uint32 *p = (Uint32 *)data;
    1.10 -	while(*p) {
    1.11 -		if ( *p > 0x10FFFF ) {
    1.12 -			return SDL_FALSE;
    1.13 -		}
    1.14 -		++p;
    1.15 -	}
    1.16 -	return SDL_TRUE;
    1.17 -}
    1.18 -
    1.19  static size_t widelen(char *data)
    1.20  {
    1.21  	size_t len = 0;
    1.22 @@ -63,13 +51,6 @@
    1.23  		ucs4 = SDL_iconv_string("UCS-4", "UTF-8", buffer, SDL_strlen(buffer)+1);
    1.24  		len = (widelen(ucs4)+1)*4;
    1.25  		for ( i = 0; i < SDL_arraysize(formats); ++i ) {
    1.26 -			if ( (SDL_strncasecmp(formats[i], "UTF16", 5) == 0 ||
    1.27 -			      SDL_strncasecmp(formats[i], "UTF-16", 6) == 0 ||
    1.28 -			      SDL_strncasecmp(formats[i], "UTF32", 5) == 0 ||
    1.29 -			      SDL_strncasecmp(formats[i], "UTF-32", 6) == 0) &&
    1.30 -			      !testutf1632(ucs4) ) {
    1.31 -				continue;
    1.32 -			}
    1.33  			test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len);
    1.34  			test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len);
    1.35  			if ( SDL_memcmp(test[1], ucs4, len) != 0 ) {