a question about drawing wchar_t with SDL_TTF
jeroen clarysse <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
given a std::wstring variable named m_text, I do the following : size_t s = 2 * sizeof(wchar_t)*(m_text.size() + 1); char * convertedChar = (char*) malloc(s); size_t res=0; ppw_wcstombs(&res, convertedChar, s, m_text.c_str(), m_text.size()); convertedChar[m_text.size()] = 0; SDL_Surface *msg1Sur = TTF_RenderUTF8_Blended_Wrapped(m_font->get_ttf_font(), convertedChar, m_fontcolor, (Uint32)m_force_width); this works nicely as long as the input string doesn’t contain unicode characters. As soon as I use something like a curly quote (“) the drawing stops right before that character can anyone point me what I’m doing wrong ? _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org