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 1304

Summary: sdl unicode bug on compile vc
Product: SDL Reporter: laybor <laybor>
Component: fileAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: 1.2.14   
Hardware: x86   
OS: Windows (XP)   

Description laybor 2011-09-09 09:44:40 UTC
L"text" in gcc is output UTF8,
L"text" in VisualC is output UTF16,
\src\file\SDL_rwops.c
in "win32_file_open" use unicode,but it's only use UTF8(MultiByteToWideChar)
Comment 1 laybor 2011-09-09 09:49:23 UTC
so SDL_LoadBMP not support chinese path.
Comment 2 Ryan C. Gordon 2011-10-12 23:05:15 UTC
SDL only deals with UTF-8 strings, so this won't work...

    SDL_LoadBMP(L"file.bmp");

...but something like this will...

   char *utf8 = SDL_iconv_string("UTF-8", "UTF-16", L"file.bmp", wcslen(L"file.bmp") + sizeof (WCHAR))
   SDL_LoadBMP(utf8);
   SDL_free(utf8);

This isn't an SDL bug. It's well-documented that SDL wants UTF-8 strings.

--ryan.