| Summary: | SDL_iconv's UCS-#-INTERNAL encodng string is incorrect | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Edward Rudd <urkle> |
| Component: | *don't know* | Assignee: | Edward Rudd <urkle> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
Edward Rudd
2014-05-21 15:52:08 UTC
OK.. upon further testing USC-4 in iconv == USC-4BE on a LE system.. UGH!. So maybe we need to add in a wrapping for SDL_iconv to translate USC-4-INTERNAL to the right thing when backed by iconv too? What exactly is the problem? I don't think there was any specific reason for using those, if there's an issue I think the encoding can be changed. The issue is the SDL_stdinc.h has some macros that use UCS-2-INTERNAL and UCS-4-INTERNAL which are only defined on Mac OS X's iconv and not on Linux's iconv. UCS-#LE and UCS-#BE are both defined (for big endian and little endian). So we really should add some code in the SDL_iconv routine to "map" UCS-#-INTERNAL to the correct more portable encoding. I'll write up a patch for this.. (as I ran into this in another game port and it BIT me in the rear) Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! (sorry if you get a lot of copies of this email, I'm marking several bugs at once) Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship. (Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.) --ryan. Edward, go ahead and submit a fix for this when you have a chance. Thanks! Edward, can you please submit your patch? Thanks! Still existing on linux.
For instance SDL_ttf/showfont fails when using option "-unicode".
because "SDL_iconv_utf8_ucs2(message)" returns NULL.
As said, replacing
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
by
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
seems to solve the issue as a workaround
|