Use the default UCS2/UCS4 conversion rather than non-portable INTERNAL encoding

Fxies https://github.com/libsdl-org/SDL/issues/1497

(cherry picked from commit d07a264a9bc42bd2d92ce12fab55f1855d0e8277)
This commit is contained in:
Sam Lantinga 2023-11-04 12:00:38 -07:00
parent e226008d83
commit 4c2eb6b95d

View file

@ -698,8 +698,8 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
const char *inbuf, const char *inbuf,
size_t inbytesleft); size_t inbytesleft);
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
/* force builds using Clang's static analysis tools to use literal C runtime /* force builds using Clang's static analysis tools to use literal C runtime