aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-03 13:57:35 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-03 13:57:50 +0200
commit1bbdd05aa36e91ee7ec5e3227339785794d607b2 (patch)
treeb238ac8ce7907fb5f26afadcfc8899fcdc991390
parentfcaea3d937a16a8d975989710f14320629c951d4 (diff)
Fix non ascii characters not rendering correctly in username
-rw-r--r--src/MessageBoard.cpp4
1 files 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));