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 2864

Summary: SDL_Main() does not get correctly encoded unicode arguments for console applications
Product: SDL Reporter: Jørgen Tjernø <jorgen>
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.1Keywords: triage-2.0.4
Hardware: All   
OS: Windows (All)   
Attachments: Define a wmain() that converts arguments to UTF8.

Description Jørgen Tjernø 2015-02-02 19:59:15 UTC
SDLmain defines main(), which gets "?" instead of unicode characters for command line arguments.

The solution is to also define a wmain(), so that the linking application can use /ENTRYPOINT:wmainCRTStartup as an argument to LINK.exe and get a unicode entrypoint that correctly handles these characters.
Comment 1 Jørgen Tjernø 2015-02-02 20:00:05 UTC
Created attachment 2015 [details]
Define a wmain() that converts arguments to UTF8.
Comment 2 Jørgen Tjernø 2015-02-02 20:00:27 UTC
Waiting to hear from icculus or slouken about this patch.
Comment 3 Ryan C. Gordon 2015-02-03 02:12:46 UTC
This looks reasonable to me. Do you still have push access?

--ryan.
Comment 4 Ryan C. Gordon 2015-02-19 05:22:23 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
Comment 5 Ryan C. Gordon 2015-02-20 02:45:28 UTC
I put this in revision control: https://hg.libsdl.org/SDL/rev/2e624f24d1af

Thanks!

--ryan.