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

Author Topic: non-ASCII characters  (Read 2127 times)

0 Members and 1 Guest are viewing this topic.

Robert

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
non-ASCII characters
« on: January 13, 2014, 08:55:25 pm »
Hi, I want to display text containing "non-ASCII characters," but I have a little problem. As a parameter for the "setString ()" gives an element of an array of strings, but that the text handle "non-ASCII characters" before the string need to write "L", but how am I supposed to do in this case when I have quoted before, which should be put the "L"? Please help me, Excuse me for grammar, etc.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: non-ASCII characters
« Reply #1 on: January 13, 2014, 09:03:39 pm »
but how am I supposed to do in this case when I have quoted before, which should be put the "L"?
I don't really understand what you mean. Could you make a short code example?

sf::String is compatible to all kinds of strings: const char*, const wchar_t*, std::string, std::wstring
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Robert

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: non-ASCII characters
« Reply #2 on: January 13, 2014, 09:13:52 pm »
text.setString(L"éèàç");
- in the guide.

In my case it looks like this:
text1.setString(mtexts[2]);

I do not know how in this case, I  can put the "L". : (

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: non-ASCII characters
« Reply #3 on: January 13, 2014, 09:47:03 pm »
If you provide all the code, we won't have to guess. What type does mtexts[2] have?

I don't see why you need a "L", since sf::String already performs a conversion.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Daddi

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
    • http://foxdev.de/
    • Email
Re: non-ASCII characters
« Reply #4 on: January 14, 2014, 07:57:50 pm »
The L is only meant for string literals, not for variables :)
If you read you text from an utf encoded file, there shouldn't be a problem.

 

anything