test/README
author Sam Lantinga <slouken@libsdl.org>
Fri, 28 Nov 2014 04:51:33 -0800
changeset 9246 a761913e5e91
parent 9012 aa058c87737b
child 9875 620024536f80
permissions -rw-r--r--
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).
slouken@0
     1
slouken@0
     2
These are test programs for the SDL library:
slouken@0
     3
patmandin@2082
     4
	checkkeys	Watch the key events to check the keyboard
patmandin@2082
     5
	loopwave	Audio test -- loop playing a WAV file
icculus@9012
     6
	loopwavequeue	Audio test -- loop playing a WAV file with SDL_QueueAudio
patmandin@2082
     7
	testaudioinfo	Lists audio device capabilities
patmandin@2082
     8
	testcdrom	Sample audio CD control program
patmandin@2082
     9
	testerror	Tests multi-threaded error handling
patmandin@2082
    10
	testfile	Tests RWops layer
slouken@6264
    11
	testgl2		A very simple example of using OpenGL with SDL
slouken@0
    12
	testhread	Hacked up test of multi-threading
patmandin@2082
    13
	testiconv	Tests international string conversion
patmandin@2082
    14
	testjoystick	List joysticks and watch joystick events
patmandin@2082
    15
	testkeys	List the available keyboard keys
patmandin@2082
    16
	testloadso	Tests the loadable library layer
slouken@0
    17
	testlock	Hacked up test of multi-threading and locking
patmandin@2082
    18
	testmultiaudio	Tests using several audio devices
slouken@886
    19
	testoverlay2	Tests the overlay flickering/scaling during playback.
patmandin@2082
    20
	testpalette	Tests palette color cycling
patmandin@2082
    21
	testplatform	Tests types, endianness and cpu capabilities
patmandin@2082
    22
	testsem		Tests SDL's semaphore implementation
eligottlieb@4799
    23
	testshape	Tests shaped windows
slouken@6264
    24
	testsprite2	Example of fast sprite movement on the screen
patmandin@2082
    25
	testtimer	Test the timer facilities
patmandin@2082
    26
	testver		Check the version and dynamic loading and endianness
slouken@6264
    27
	testwm2		Test window manager -- title, icon, events
patmandin@2082
    28
	torturethread	Simple test for thread creation/destruction
gabomdq@8043
    29
	controllermap   Useful to generate Game Controller API compatible maps
gabomdq@8043
    30
gabomdq@8043
    31