premake/README-macosx.txt
author Sam Lantinga <slouken@libsdl.org>
Fri, 28 Nov 2014 04:51:33 -0800
changeset 9246 a761913e5e91
parent 9112 345a7d41dda9
permissions -rwxr-xr-x
Fixed bug 2786 - "UCS-2-INTERNAL" iconv encoding is not supported everywhere, use UTF-16LE instead

Jonas Kulla

src/main/windows/SDL_windows_main.c:137:
cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR));

I'm trying to compile an SDL2 application for windows using the mingw-w64 32bit toolchain provided by my distro (Fedora 19). However, even the simplest test program that does nothing at all fails to startup with a "Fatal error - out of memory" message because the mingw iconv library provided by my distro does not support the "UCS-2-INTERNAL" encoding and the conversion returns null.

From my little bit of research, it turns out that even though this encoding is supported by the external GNU libiconv library, some glibc versions (?) don't support it with their internal iconv routines, and will instead provide the native endian encoding when "UCS-2" is specified.

Nonetheless, I wonder why the native endianness is considered in the first place when Windows doesn't even run on any big endian archs (to my knowledge). And true enough, 'WIN_StringToUTF8' from core/windows/SDL_windows.h is used everywhere else in the windows backend, which is just a macro to iconv with "UTF-16LE" as source. Therefore it would IMO make sense to use this macro here as well, which would solve my problem (patch attached).
     1 Use the Xcode command files (located in the Xcode/build-scripts folder)
     2 to conveniently generate a workspace for Xcode 3 or Xcode 4. It also
     3 contains a cleaner script and a convenient script for automatically
     4 running all the test suites.
     5 
     6 If you use the script to automatically build the workspace file, you
     7 need to open the workspace at least once after generating it, or it
     8 will give errors that certain schema do not exist within the workspace.
     9 Also, the script depends on Xcode command line tools being installed.
    10 
    11 There are separate build files for building for i386 architecture
    12 versus x86_64 architecture. There are separate build scripts for
    13 Xcode 3 versus Xcode 4, but these just use the different toolchains.
    14 
    15 There is a script for automatically running through all known supported
    16 tests on that platform.
    17 
    18 The Mac OS X projects currently have reliance on the following dependencies:
    19 
    20   -CoreVideo.framework
    21   -AudioToolbox.framework
    22   -AudioUnit.framework
    23   -Cocoa.framework
    24   -CoreAudio.framework
    25   -IOKit.framework
    26   -Carbon.framework
    27   -ForceFeedback.framework
    28   -CoreFoundation.framework
    29 
    30 It will also link to OpenGL.framework, as the dependency function for OpenGL
    31 assumes that OpenGL always exists on Mac OS X. However, this is defined in
    32 a segmented way to allow the possibility of no OpenGL support on Mac OS X.
    33 
    34 Run the clean script to clear out the directory of Xcode-related files
    35 and binaries.