diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index d4256b53..ab2c8746 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -1997,7 +1997,13 @@ static int GAME_EXPORT pfnDrawCharacter( int x, int y, int number, int r, int g, int flags = FONT_DRAW_HUD; if( hud_utf8.value ) - flags |= FONT_DRAW_UTF8; + { + static utfstate_t utfstate; + number = Q_DecodeUTF8( &utfstate, number ); + + if( !number ) + return 0; + } return CL_DrawCharacter( x, y, number, color, &cls.creditsFont, flags ); } diff --git a/engine/client/cl_mobile.c b/engine/client/cl_mobile.c index 7e441830..c6e60c75 100644 --- a/engine/client/cl_mobile.c +++ b/engine/client/cl_mobile.c @@ -19,6 +19,7 @@ GNU General Public License for more details. #include "library.h" #include "input.h" #include "platform/platform.h" +#include "utflib.h" static CVAR_DEFINE_AUTO( vibration_length, "1.0", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "vibration length" ); static CVAR_DEFINE_AUTO( vibration_enable, "1", FCVAR_ARCHIVE | FCVAR_PRIVILEGED, "enable vibration" ); @@ -58,7 +59,13 @@ static int pfnDrawScaledCharacter( int x, int y, int number, int r, int g, int b int flags = FONT_DRAW_HUD; if( hud_utf8.value ) - SetBits( flags, FONT_DRAW_UTF8 ); + { + static utfstate_t utfstate; + number = Q_DecodeUTF8( &utfstate, number ); + + if( !number ) + return 0; + } if( fabs( g_font_scale - scale ) > 0.1f || g_scaled_font.hFontTexture != cls.creditsFont.hFontTexture )