We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2065

Summary: SDL_messagebox only prints one character of the message
Product: SDL Reporter: Nathaniel J Fries <nfries88>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86   
OS: Windows 7   

Description Nathaniel J Fries 2013-08-27 05:25:04 UTC
Example:
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Hello", "World", 0);

The result is a message box with the title properly "Hello", but with the text inside the message box being only "W".

Revision: 7700
OS: Windows 7 64-bit
Compiler: MinGW32, GCC 4.7.2
Target: i686, Windows Console 32-bit

Flags from makefile generated by configure:
CFLAGS  = -g -O3 -DUSING_GENERATED_CONFIG_H
EXTRA_CFLAGS = -I./include  -mmmx -m3dnow -msse -mpreferred-stack-boundary=2 -Wall
LDFLAGS = 
EXTRA_LDFLAGS =  -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc
Comment 1 Nathaniel J Fries 2013-08-29 12:13:38 UTC
The issue appears to be in the definition of the macro WIN_UTF8ToString

When I force unicode by adding -DUNICODE and -D_UNICODE in the makefile and rebuilding, the issue is resolved.
Comment 2 Sam Lantinga 2013-10-18 06:18:44 UTC
This was an issue with the mingw32 build.  Fixed!
http://hg.libsdl.org/SDL/rev/1451063c8ecd