mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 19:18:30 +00:00
SDL_iconv_string() defaults to UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/8287
This commit is contained in:
@@ -786,17 +786,13 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb
|
|||||||
size_t outbytesleft;
|
size_t outbytesleft;
|
||||||
size_t retCode = 0;
|
size_t retCode = 0;
|
||||||
|
|
||||||
cd = SDL_iconv_open(tocode, fromcode);
|
if (tocode == NULL || !*tocode) {
|
||||||
if (cd == (SDL_iconv_t)-1) {
|
tocode = "UTF-8";
|
||||||
/* See if we can recover here (fixes iconv on Solaris 11) */
|
|
||||||
if (tocode == NULL || !*tocode) {
|
|
||||||
tocode = "UTF-8";
|
|
||||||
}
|
|
||||||
if (fromcode == NULL || !*fromcode) {
|
|
||||||
fromcode = "UTF-8";
|
|
||||||
}
|
|
||||||
cd = SDL_iconv_open(tocode, fromcode);
|
|
||||||
}
|
}
|
||||||
|
if (fromcode == NULL || !*fromcode) {
|
||||||
|
fromcode = "UTF-8";
|
||||||
|
}
|
||||||
|
cd = SDL_iconv_open(tocode, fromcode);
|
||||||
if (cd == (SDL_iconv_t)-1) {
|
if (cd == (SDL_iconv_t)-1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user