Skip to content

Commit

Permalink
Fixed iconv handling on Solaris 11
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 12, 2007
1 parent 50f881f commit 52c3e5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/stdlib/SDL_iconv.c
Expand Up @@ -806,6 +806,16 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb
size_t retCode = 0;

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;
}
Expand Down

0 comments on commit 52c3e5c

Please sign in to comment.