Skip to content
Permalink
Browse files

Fixed iconv handling on Solaris 11

  • Loading branch information
slouken committed Jul 12, 2007
1 parent 50f881f commit 52c3e5c091bbe8f16df4ffdff8616b444b23281d
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/stdlib/SDL_iconv.c
@@ -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;
}

0 comments on commit 52c3e5c

Please sign in to comment.