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 6612 9a22ac8befa9
parent 6611 5c8b5b03ad8a
child 6613 0a8672b04b00
Need to use the new UCS-2-INTERNAL encoding for windows strings
src/core/windows/SDL_windows.h
--- a/src/core/windows/SDL_windows.h	Sun Oct 28 14:16:18 2012 -0700
+++ b/src/core/windows/SDL_windows.h	Sun Oct 28 19:28:44 2012 -0700
@@ -37,8 +37,8 @@
 
 /* Routines to convert from UTF8 to native Windows text */
 #if UNICODE
-#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
-#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)(S), SDL_strlen(S)+1)
+#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
+#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1)
 #else
 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)