Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux  (Read 5210 times)

0 Members and 1 Guest are viewing this topic.

HeinzK

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • ZwiAner
    • Email
deleted
« Last Edit: December 04, 2019, 08:27:22 am by HeinzK »
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
« Reply #2 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
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
« Reply #3 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 :)
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
« Reply #4 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
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
« Reply #5 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.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window.draw(Text) .. 'ABC ÄÖÜ äöü ß' .. Windows/Linux
« Reply #6 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?
Laurent Gomila - SFML developer

 

anything