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 - sdl unicode bug on compile vc
Summary: sdl unicode bug on compile vc
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: file (show other bugs)
Version: 1.2.14
Hardware: x86 Windows (XP)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 09:44 UTC by laybor
Modified: 2011-10-12 23:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.