Skip to content

Commit d58fa94

Browse files
committed
SDL_iconv_string() defaults to UTF-8
Fixes #8287 (cherry picked from commit 1375d20) (cherry picked from commit 9772d05)
1 parent d691010 commit d58fa94

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Diff for: src/stdlib/SDL_iconv.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -795,17 +795,13 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb
795795
size_t outbytesleft;
796796
size_t retCode = 0;
797797

798-
cd = SDL_iconv_open(tocode, fromcode);
799-
if (cd == (SDL_iconv_t)-1) {
800-
/* See if we can recover here (fixes iconv on Solaris 11) */
801-
if (tocode == NULL || !*tocode) {
802-
tocode = "UTF-8";
803-
}
804-
if (fromcode == NULL || !*fromcode) {
805-
fromcode = "UTF-8";
806-
}
807-
cd = SDL_iconv_open(tocode, fromcode);
798+
if (tocode == NULL || !*tocode) {
799+
tocode = "UTF-8";
800+
}
801+
if (fromcode == NULL || !*fromcode) {
802+
fromcode = "UTF-8";
808803
}
804+
cd = SDL_iconv_open(tocode, fromcode);
809805
if (cd == (SDL_iconv_t)-1) {
810806
return NULL;
811807
}

0 commit comments

Comments
 (0)