diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index 834652bf0..4fb0f8248 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -832,7 +832,7 @@ SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, tocode = "UTF-8"; } if (!fromcode || !*fromcode) { - tocode = "UTF-8"; + fromcode = "UTF-8"; } cd = SDL_iconv_open(tocode, fromcode); }