Commit 98c31870 authored by Sam Lantinga's avatar Sam Lantinga

Fixed iconv handling on Solaris 11

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402502
parent 49f5340a
...@@ -806,6 +806,16 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb ...@@ -806,6 +806,16 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb
size_t retCode = 0; size_t retCode = 0;
cd = SDL_iconv_open(tocode, fromcode); 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 ) { if ( cd == (SDL_iconv_t)-1 ) {
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment