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 1069

Summary: SDL_iconv: UTF-8 to UCS-2 conversion error
Product: SDL Reporter: Alexander Iljin <ajsoft>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: jspradlin
Version: 1.2.14   
Hardware: All   
OS: All   
Attachments: Delphi project source demonstrating the bug

Description Alexander Iljin 2010-10-23 07:33:56 UTC
Created attachment 542 [details]
Delphi project source demonstrating the bug

I tried to use SDL_WM_SetCaption. I passed it some UTF-8 encoded Russian text, but got question marks in the window caption. (I tried both WITH and WITHOUT the BOM header. The byte order mark was correctly removed from the text, but the rest of the text was still the same set of "invalid character" symbols.) I traced the problem down to SDL_iconv incorrectly processing the string.

The attached Delphi project demonstrates that WinApi correctly handles the sample text, while SDL_iconv_string returns the question marks.

The test project currently shows the following two messages for the same input data:

---------------------------
WinApi result
---------------------------
АБВГДЕЖЗИЙКЛМНОП
---------------------------
ОК   
---------------------------

---------------------------
SDL result
---------------------------
����������������
---------------------------
ОК   
---------------------------
Comment 1 Jen Spradlin 2011-04-12 20:09:59 UTC
Thank you for your bug report!

We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible.
Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 2 Alexander Iljin 2011-04-12 21:29:21 UTC
> Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
> http://www.libsdl.org/tmp/SDL-1.3.zip

  I'll be glad to help you make sure the bug is fixed, but I can only test against a compiled DLL. I've got no tools to build SDL from source. Can you give me a link to a nightly build or some such?
Comment 3 Alexander Iljin 2011-04-17 19:18:34 UTC
(In reply to comment #1)
> Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
> http://www.libsdl.org/tmp/SDL-1.3.zip

  A friend of mine built the DLL for me and I confirm that the bug is no longer there. Good job!