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 733

Summary: UNICODE File Name Failed on SDL_LoadBMP()
Product: SDL Reporter: ddayin <ddayin>
Component: fileAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: ddayin
Version: 1.2.13Keywords: target-1.2.14
Hardware: x86   
OS: Windows (CE)/PocketPC   
Attachments: Proposed Unicode fix for Win32 RWOPS.

Description ddayin 2009-04-26 19:34:36 UTC
Hello.

My English is bad to read, but I want to report this bug.

I have advantage of SDL in developing multi platform.

I am developing game for Windows CE 5.0.

If file name is in UNICODE, SDL fails to load any resources from local disk.

I also tested on Windows XP.

It is enable to load file in UNICODE.

I know that SDL doesn't support WinCE officially.

But if anyone know how to fix this problem, please let me know. :D
Comment 1 Ryan C. Gordon 2009-09-13 16:33:12 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Ryan C. Gordon 2009-09-19 12:58:10 UTC
Created attachment 368 [details]
Proposed Unicode fix for Win32 RWOPS.


Here's a proposed patch for allowing Unicode filenames in RWOPS on Windows. I haven't tried to compile this, as it's just proof-of-concept.

Sam, if this looks reasonable, I'll clean it up. We probably don't need this much tapdancing for 1.3, as we probably don't care about anything before Windows XP.

--ryan.
Comment 3 Ryan C. Gordon 2009-09-19 13:00:05 UTC
Oh, I noticed you mentioned Windows CE, where this should already work. In that case, you need to give the filename in UTF-8 format. If you try to do...

   SDL_LoadBMP((char*) TEXT("Unicode File Name"));

...then it won't work.

The patch I posted should still be good, though, for desktop Windows.

--ryan.
Comment 4 Sam Lantinga 2009-09-21 04:18:18 UTC
Ryan, go ahead and make it so.

I agree that this is likely to be unnecessary on 1.3, where we can just use our handy UTF8->native conversion functions and we always use the UNICODE API functions.
Comment 5 Ryan C. Gordon 2009-10-08 00:48:51 UTC
Fixed in svn revision #4974.

--ryan.