.hgignore
author Sam Lantinga <slouken@libsdl.org>
Fri, 28 Nov 2014 04:51:33 -0800
changeset 9246 a761913e5e91
parent 9012 aa058c87737b
child 9507 b1e690e9c5b3
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).
     1 syntax:glob
     2 aclocal.m4
     3 autom4te*
     4 config.cache
     5 config.log
     6 config.status
     7 Makefile
     8 sdl-config
     9 SDL2.spec
    10 build
    11 
    12 # for Xcode
    13 *.orig
    14 *.swp
    15 *.tmp
    16 *.rej
    17 *~
    18 *.o
    19 *.mode1*
    20 *.model*
    21 *.perspective*
    22 *.perspective*
    23 *.pbxuser
    24 (^|/)build($|/)
    25 .DS_Store
    26 Xcode/SDL/SDL.xcodeproj/xcuserdata
    27 Xcode/SDL/SDL.xcodeproj/project.xcworkspace
    28 Xcode/SDLTest/SDLTest.xcodeproj/xcuserdata
    29 Xcode/SDLTest/SDLTest.xcodeproj/project.xcworkspace
    30 Xcode-iOS/SDL/SDL.xcodeproj/xcuserdata
    31 Xcode-iOS/SDL/SDL.xcodeproj/project.xcworkspace
    32 Xcode-iOS/Demos/Demos.xcodeproj/xcuserdata
    33 Xcode-iOS/Demos/Demos.xcodeproj/project.xcworkspace
    34 
    35 # for Visual C++
    36 Debug
    37 Release
    38 *.user
    39 *.ncb
    40 *.suo
    41 *.sdf
    42 VisualC/tests/loopwave/sample.wav
    43 VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
    44 VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
    45 VisualC/tests/testgamecontroller/axis.bmp
    46 VisualC/tests/testgamecontroller/button.bmp
    47 VisualC/tests/testgamecontroller/controllermap.bmp
    48 VisualC/tests/testoverlay2/moose.dat
    49 VisualC/tests/testrendertarget/icon.bmp
    50 VisualC/tests/testrendertarget/sample.bmp
    51 VisualC/tests/testscale/icon.bmp
    52 VisualC/tests/testscale/sample.bmp
    53 VisualC/tests/testsprite2/icon.bmp
    54 VisualC/visualtest/icon.bmp
    55 VisualC/visualtest/testquit.actions
    56 VisualC/visualtest/testquit.config
    57 VisualC/visualtest/testquit.exe
    58 VisualC/visualtest/testquit.parameters
    59 VisualC/visualtest/testsprite2.exe
    60 VisualC/visualtest/testsprite2_sample.actions
    61 VisualC/visualtest/testsprite2_sample.config
    62 VisualC/visualtest/testsprite2_sample.parameters
    63 
    64 # for Android
    65 android-project/local.properties
    66 
    67 sdl.pc
    68 test/autom4te*
    69 test/config.cache
    70 test/config.log
    71 test/config.status
    72 test/Makefile
    73 test/SDL2.dll
    74 test/checkkeys
    75 test/loopwave
    76 test/loopwavequeue
    77 test/testatomic
    78 test/testaudioinfo
    79 test/testautomation
    80 test/testdraw2
    81 test/testerror
    82 test/testfile
    83 test/testgamecontroller
    84 test/testgesture
    85 test/testgl2
    86 test/testgles
    87 test/testhaptic
    88 test/testhittesting
    89 test/testiconv
    90 test/testime
    91 test/testintersections
    92 test/testjoystick
    93 test/testkeys
    94 test/testloadso
    95 test/testlock
    96 test/testmessage
    97 test/testmultiaudio
    98 test/testnative
    99 test/testoverlay2
   100 test/testplatform
   101 test/testpower
   102 test/testfilesystem
   103 test/testrelative
   104 test/testrendercopyex
   105 test/testrendertarget
   106 test/testresample
   107 test/testrumble
   108 test/testscale
   109 test/testsem
   110 test/testshader
   111 test/testshape
   112 test/testsprite2
   113 test/testspriteminimal
   114 test/teststreaming
   115 test/testthread
   116 test/testtimer
   117 test/testver
   118 test/testwm2
   119 test/torturethread
   120 test/*.exe
   121 test/*.dSYM
   122 buildbot
   123 test/buildbot