# HG changeset patch # User Sam Lantinga # Date 1184226449 0 # Node ID 64bf737873a237068bb4be6483ef9d5791b1851e # Parent 0aadbc81c4975eb88c30eb4e09c87f96261e4eb4 Fixed iconv handling on Solaris 11 diff -r 0aadbc81c497 -r 64bf737873a2 src/stdlib/SDL_iconv.c --- a/src/stdlib/SDL_iconv.c Thu Jul 12 07:29:19 2007 +0000 +++ b/src/stdlib/SDL_iconv.c Thu Jul 12 07:47:29 2007 +0000 @@ -807,6 +807,16 @@ cd = SDL_iconv_open(tocode, fromcode); if ( cd == (SDL_iconv_t)-1 ) { + /* See if we can recover here (fixes iconv on Solaris 11) */ + if ( !tocode || !*tocode ) { + tocode = "UTF-8"; + } + if ( !fromcode || !*fromcode ) { + tocode = "UTF-8"; + } + cd = SDL_iconv_open(tocode, fromcode); + } + if ( cd == (SDL_iconv_t)-1 ) { return NULL; }