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 1485

Summary: Problems with non-ASCII chars in image paths in Windows 7
Product: SDL_image Reporter: Pere <perepujal>
Component: miscAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: omarandemad
Version: 1.2.12   
Hardware: x86   
OS: Windows 7   

Description Pere 2012-04-27 14:18:14 UTC
Hi, at Tux Paint there is this bug report [1], a quick test with fopen(fname, "r")) goes right, so the images are accesible at the path described by fname.

An additional test is -with the file manager inside W7- to drag a image over showimage.exe, the results are that the image only displays if the chars of the path to the image are all ASCII.

[1] http://sourceforge.net/tracker/?func=detail&aid=3473049&group_id=66938&atid=516295
Comment 1 Pere 2012-05-24 13:54:03 UTC
Well, I followed the trace of the filaname passed to IMG_Load() up to the win32_file_open() function in the SDL-1.2.15/src/file/SDL_rwops.c file, it is unchanged untill arriving there, then it is recoded in this function, thus changing the path and avoiding to load the file.

If in win32_file_open() I force the use of filename as it is passed to the function ( h = CreateFile(filename, (w_right|r_right).....) instead of the recoded filenameW (h = CreateFileW(filenameW, (w_right|r_right), .....), then it loads right the images with non ascii chars on their path.

I don't provide a patch as I don't know enouth the code to understand what side effects this change can have.

Hope this helps
Pere