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.
| Summary: |
Suggestion |
| Product: |
SDL
|
Reporter: |
mosfet <forumer> |
| Component: |
*don't know* | Assignee: |
Ryan C. Gordon <icculus> |
| Status: |
RESOLVED
FIXED
|
QA Contact: |
Sam Lantinga <slouken> |
| Severity: |
normal
|
|
|
| Priority: |
P2
|
|
|
| Version: |
HG 2.0 | |
|
| Hardware: |
x86 | |
|
| OS: |
All | |
|
Hi, Please read this message until then end and don't say no before ;-). I am programming for 6 years now on window ce and symbian and there is something I ama really fed up with its ANSI/UTF16 conversion. I have started a new frameworks that I hope will start to be useful in 1/2 years but until now I am using SDL for video handling. Could it be possible to create a unicode aware version of SDL. Actually I have already started to do it on my local copy of SDL, I have created a SDL_tchar.h : #ifndef _SDL_tchar_h #define _SDL_tchar_h #if defined(_WIN32) ||defined(_WIN32_WCE) // For now we define as char typedef TCHAR SDL_Char; #define SDL_strcpy _tcscpy ... ... ... #else typedef char SDL_Char; #define SDL_strcpy _strcpy #endif If you do something like that it will be compatible with all existing version of SDL because as long as UNICODE is not defined a SDL_Char will be a char. But later on if you replace all strings "" by _T("") and char* by SDL_Char*, it will be possible to use UNICODE version on win and wince. And Finally I would be able to do something like that : LPCTSTR szFileName = myunicodeapi ( .... ); SDL_Load(szFileName); instead of char szFileNameA[MAX_PATH]; wcstombs(...) SDL_Load(szFileNameA); I have that kind of code verywhere and it's so ugly and could be easily handled by SDL. So for linux people they could still write SDl_XXX("") and for win/wince/Symbian people we could write SDL_XXX(_T("")) Finally if you want maximum compatibilities you could force you to always use _T() macros (or SDL_T() for instance). So please consider my proposal, I think it would be so easy to use UNICODE aware api. The only conversion would be to attack image lib (libjpeg, libpng, ...) and it's not sure because wince implements also ANSI version of fopen. Regards vrichomme [AT] smartmobili [D.O.T] com #endif /* _SDL_tchar_h */