Hi!
Any non-ASCII characters in the Window/RenderWindow title seem to be simply skipped over by SFML, yet display correctly in the titles of other windows.
Code:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char ** argv) {
sf::RenderWindow window(sf::VideoMode(300, 200), u8"Unicode: naïve こんにちは");
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
window.close();
}
}
window.clear(sf::Color::White);
window.display();
}
return 0;
}
Running it gives:
(https://i.imgur.com/E8ho4y3.png)
The non-ASCII characters are skipped or replaced with a space.
I have ruled out font/etc issues, since setting a webpage's title to the same string works perfectly:
(https://i.imgur.com/VZylDTm.png)
Any ideas?
Thanks in advance!
It works for me when replacing u8 by L:
sf::RenderWindow window(sf::VideoMode(300, 200), L"Unicode: naïve こんにちは");
I've noticed in the past that sf::String works more reliably when using wide-strings instead of UTF8 strings on linux (unless you manually use sf::String::fromUft8 and sf::String::toUtf8).
It works for me when replacing u8 by L:
sf::RenderWindow window(sf::VideoMode(300, 200), L"Unicode: naïve こんにちは");
I've noticed in the past that sf::String works more reliably when using wide-strings instead of UTF8 strings on linux (unless you manually use sf::String::fromUft8 and sf::String::toUtf8).
Thanks! That solves it.