Fixed iconv handling on Solaris 11 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Jul 2007 07:47:29 +0000
branchSDL-1.2
changeset 405464bf737873a2
parent 4053 0aadbc81c497
child 4055 6ed1fded55ff
Fixed iconv handling on Solaris 11
src/stdlib/SDL_iconv.c
     1.1 --- a/src/stdlib/SDL_iconv.c	Thu Jul 12 07:29:19 2007 +0000
     1.2 +++ b/src/stdlib/SDL_iconv.c	Thu Jul 12 07:47:29 2007 +0000
     1.3 @@ -807,6 +807,16 @@
     1.4  
     1.5  	cd = SDL_iconv_open(tocode, fromcode);
     1.6  	if ( cd == (SDL_iconv_t)-1 ) {
     1.7 +		/* See if we can recover here (fixes iconv on Solaris 11) */
     1.8 +		if ( !tocode || !*tocode ) {
     1.9 +			tocode = "UTF-8";
    1.10 +		}
    1.11 +		if ( !fromcode || !*fromcode ) {
    1.12 +			tocode = "UTF-8";
    1.13 +		}
    1.14 +		cd = SDL_iconv_open(tocode, fromcode);
    1.15 +	}
    1.16 +	if ( cd == (SDL_iconv_t)-1 ) {
    1.17  		return NULL;
    1.18  	}
    1.19