From: Matt Mullins Date: Wed, 30 May 2012 05:10:46 +0000 (-0700) Subject: Render all text with the UTF-8 encoding. X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=295dea89cbd3e7f34cbe40a26a61e6cf9137b26c;p=IvanGame.git Render all text with the UTF-8 encoding. This fixes issues where Japanese characters are showing up as boxes. --- diff --git a/Level.cpp b/Level.cpp index 588439b..d16b65e 100644 --- a/Level.cpp +++ b/Level.cpp @@ -55,10 +55,8 @@ void SDL_GL_RenderText(string s, TTF_Font *font, SDL_Color color, SDL_Rect *loca int w,h; Texture texture; - Uint16 t[] = {'日','本','語'}; - /* Use SDL_TTF to render our text */ - initial = unicode?TTF_RenderUNICODE_Blended(font, t, color):TTF_RenderText_Blended(font, text, color); + initial = TTF_RenderUTF8_Blended(font, s.c_str(), color); /* Convert the rendered text to a known format */ w = initial->w;