Title: Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
Post by: Laurent on May 14, 2012, 09:46:03 am
What the link above was supposed to teach you is that we need more information: - a description of the problem (what happens?) - the version of SFML that you use - the relevant part of your code
Title: Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
Post by: Laurent on May 14, 2012, 10:20:09 am
Try this:
Txt.setString(L"ABC ÄÖÜ äöü ß");
And please use the "code=cpp" tag in your posts to have syntax highlighting :)
Title: Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
Post by: Laurent on May 14, 2012, 10:38:17 am
Quote
I already use 'code=cpp'
Hmm, so why do I have to edit all your posts to add it? ;D
Title: Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
Post by: Laurent on May 14, 2012, 12:41:26 pm
L"..." will produce a wide string (made of wchar_t characters), so if you want to store it before passing it to sf::Text, you must put it in a std::wstring. Or a sf::String.
Title: Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
Post by: Laurent on May 14, 2012, 04:27:49 pm
Getting non-ASCII characters correctly displayed on screen can be very tricky, especially for string literals. Multiple encodings are involved, and it's very hard to control the complete chain for non-experienced users.
The problem here is probably that the compiler doesn't like your source file encoding. Is it UTF-8? latin-1? something else?