Utf8 to unicode conversion problem

Hi,

I am using SDL_ttf library to display text on my GUI.
There’s a wierd problem –
If I have character ‘?’ as a trailing character in a
string for eg- ‘Cirque Soleil’s K?’ the code breaks in
SDL_FreeSurface. I am currently using the function
"TTF_RenderUTF8_Blended" in SDL_ttf library to change
the UTF8 text to unicode. The library works fine for
multilanguage support but breaks only with the above
character.

I tried using “TTF_RenderText_Blended” and the code
works fine except it splits the ‘?’ character in 2
different characters 1st one being A with chinese ~ on
top and 2nd chinese yen symbol). I believe ‘?’ takes 2
bytes instead of one hence the memory dosent get
allocated properly causing the code to fail when
freeing it.

Please let me know if anyone finds a possible
solution.

Thanks
Namrata__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

namrata_limaye at yahoo.com wrote:

I am using SDL_ttf library to display text on my GUI.
There’s a wierd problem –
If I have character ‘?’ as a trailing character in a
string for eg- ‘Cirque Soleil’s K?’ the code breaks in
SDL_FreeSurface. I am currently using the function
"TTF_RenderUTF8_Blended" in SDL_ttf library to change
the UTF8 text to unicode.

TTF_RenderUTF8_Blended renders strings ending in ‘?’ just fine here
(that’s LATIN CAPITAL LETTER A WITH GRAVE, right?). SDL_ttf 2.0.6 on Mac
OS X 10.4.5. Are you sure your ? is properly UTF-8 encoded (should be C3
80)?

-Christian