Simple Directmedia Layer
Go to file
Sam Lantinga 4dab32a2bc 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).
2014-11-28 04:51:33 -08:00
acinclude Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
android-project Added name for second Java Thread on Android. 2014-11-23 20:35:51 +01:00
build-scripts Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
cmake Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
debian Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
docs WinRT: added SDL_HINT_WINRT_PREF_PATH_ROOT 2014-11-27 09:55:34 -05:00
include WinRT: added SDL_HINT_WINRT_PREF_PATH_ROOT 2014-11-27 09:55:34 -05:00
premake Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
src Fixed bug 2786 - "UCS-2-INTERNAL" iconv encoding is not supported everywhere, use UTF-16LE instead 2014-11-28 04:51:33 -08:00
test add "i" shortcut to testgesture tool to log # of fingers down on the touch devices. 2014-11-23 15:39:28 -05:00
VisualC Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
VisualC-WinRT Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
visualtest Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Xcode add controllermap program to SDLTest xcode project 2014-11-23 15:21:49 -05:00
Xcode-iOS Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
.hgignore Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Android.mk Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
autogen.sh Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
BUGS.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
cmake_uninstall.cmake.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
CMakeLists.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
configure Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
configure.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
COPYING.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
CREDITS.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
INSTALL.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Makefile.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Makefile.minimal Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Makefile.pandora Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Makefile.psp Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
Makefile.wiz Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
README-SDL.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
README.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
sdl2-config.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
sdl2.m4 Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
sdl2.pc.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
SDL2.spec.in Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
TODO.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
VisualC.html Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00
WhatsNew.txt Corrected header file documentation comment. 2014-11-22 22:20:40 +01:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)