Need to use the new UCS-2-INTERNAL encoding for windows strings
authorSam Lantinga <slouken@libsdl.org>
Sun, 28 Oct 2012 19:28:44 -0700
changeset 66129a22ac8befa9
parent 6611 5c8b5b03ad8a
child 6613 0a8672b04b00
Need to use the new UCS-2-INTERNAL encoding for windows strings
src/core/windows/SDL_windows.h
     1.1 --- a/src/core/windows/SDL_windows.h	Sun Oct 28 14:16:18 2012 -0700
     1.2 +++ b/src/core/windows/SDL_windows.h	Sun Oct 28 19:28:44 2012 -0700
     1.3 @@ -37,8 +37,8 @@
     1.4  
     1.5  /* Routines to convert from UTF8 to native Windows text */
     1.6  #if UNICODE
     1.7 -#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
     1.8 -#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)(S), SDL_strlen(S)+1)
     1.9 +#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
    1.10 +#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1)
    1.11  #else
    1.12  #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
    1.13  #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)