SFML title bar with weird characters when using UTF-8

Posted by TheOm3ga on Game Development See other posts from Game Development or by TheOm3ga
Published on 2011-02-09T22:10:58Z Indexed on 2011/02/09 23:35 UTC
Read the original article Hit count: 288

Filed under:
|

(Previously asked at http://stackoverflow.com/questions/4922478/sfml-title-bar-with-weird-characters-when-using-utf-8)

I've just started using SFML and one of the first problems I've come across is some weird characters on the the titlebar whenever I try to use accents or any other extended char.

For instance, I've got:

sf::RenderWindow Ventana(sf::VideoMode(800, 600, 32), "Año nuevóóó");

And the titlebar renders like AÂ+o nuevoA³A³A³

This ONLY HAPPENS if my source code file is enconded in UTF-8. If I change the file encoding to ISO-8859-1, it shows properly. Obviously all of my files use UTF-8, as its the system-wide encoding. I'm using GCC under Ubuntu GNU/Linux.

I've tried using the different utilities in sf::Unicode to adapt the text, but none of them seems to work.

© Game Development or respective owner

Related posts about c++

Related posts about sfml