From 1bbdd05aa36e91ee7ec5e3227339785794d607b2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 3 May 2018 13:57:35 +0200 Subject: Fix non ascii characters not rendering correctly in username --- src/MessageBoard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp index 1e5790c..71b622f 100644 --- a/src/MessageBoard.cpp +++ b/src/MessageBoard.cpp @@ -115,7 +115,7 @@ namespace dchat position.y += (MESSAGE_PADDING_TOP * Settings::getScaling()); if(position.y + usernameTextHeight > 0.0f && position.y < backgroundPos.y + backgroundSize.y) { - sf::Text usernameText(message->user->getName(), *usernameFont, usernameTextCharacterSize); + sf::Text usernameText(sf::String::fromUtf8(message->user->getName().begin(), message->user->getName().end()), *usernameFont, usernameTextCharacterSize); usernameText.setFillColor(sf::Color(15, 192, 252)); usernameText.setPosition(sf::Vector2f(floor(position.x), floor(position.y))); window.draw(usernameText); @@ -179,7 +179,7 @@ namespace dchat position.y += (MESSAGE_PADDING_TOP * Settings::getScaling()); if(position.y + usernameTextHeight > 0.0f && position.y < backgroundPos.y + backgroundSize.y) { - string usernameTextStr = message->user->getName(); + sf::String usernameTextStr = sf::String::fromUtf8(message->user->getName().begin(), message->user->getName().end()); usernameTextStr += " - "; sf::Text usernameText(usernameTextStr, *usernameFont, usernameTextCharacterSize); usernameText.setFillColor(sf::Color(15, 192, 252)); -- cgit v1.2.3