src/core/windows/SDL_windows.h
changeset 7833 b4a9cc7085f2
parent 7660 78204ab75b0f
child 8149 681eb46b8ac4
child 8535 e8ee0708ef5c
equal deleted inserted replaced
7832:e2188abb7c10 7833:b4a9cc7085f2
    33 #define _WIN32_WINNT  0x501   /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
    33 #define _WIN32_WINNT  0x501   /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
    34 
    34 
    35 #include <windows.h>
    35 #include <windows.h>
    36 
    36 
    37 /* Routines to convert from UTF8 to native Windows text */
    37 /* Routines to convert from UTF8 to native Windows text */
    38 /* !!! FIXME: should we force Unicode at this point? */
       
    39 #if UNICODE
    38 #if UNICODE
    40 /* !!! FIXME: UCS-2 should be UTF-16 on Windows. */
    39 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UTF-16LE", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
    41 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
    40 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (char *)(S), SDL_strlen(S)+1)
    42 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1)
       
    43 #else
    41 #else
    44 /* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */
    42 /* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */
    45 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
    43 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
    46 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
    44 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
    47 #endif
    45 #endif