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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - poq

Pages: [1]
1
General / Re: Encoding problem, Xcode
« on: September 27, 2012, 08:27:28 pm »
Nothing helps with title encoding, it's not supported yet ;)

Works perfectly on Windows  :). I've tried it on Windows 7 with VS 2010, and both title and sf::Text worked correctly from scratch.

So how do you convert them?

Just this way:

sf::Utf<8>::toWide(str.begin(), str.end(), str1.begin());


Also, seems to be relevant to the issue:

http://stackoverflow.com/questions/9246043/wcslen-works-differently-in-xcode-and-vc

2
General / Re: Encoding problem, Xcode
« on: September 27, 2012, 06:31:09 pm »
Thanks.

So far two options solved it for me when rendering text:

1. Changing compiler from Apple LLVM to LLVM GCC in project properties.
2. Or converting strings from utf-8 to wide (while still using Apple LLVM). I have not figured how Utf::toWide works yet though, but it showed typed characters correctly.

Neither of them will help with title encoding.


3
General / Encoding problem, Xcode
« on: September 26, 2012, 02:09:40 pm »
Hi,

Just found this promising library and then stumbled with an encoding problem.

I use Xcode 4.2 and SFML 2 RC (installer). Source files are encoded in UTF-8.

I am trying to get Cyrillic chars to be shown properly using the SFML Application template:

    // Create a graphical text to display
    sf::Font font;
    if (!font.loadFromFile(resourcePath() + "mplus-1p-medium.ttf"))
        return EXIT_FAILURE;
    sf::Text text(L"\u043A &#1082; k", font, 50);
    text.setColor(sf::Color::Black);

(there's a Cyrillic K instead of html code in the source, seems there's a problem with encoding on the forums too  :D).

Default font which comes in Resources doesn't have non-Latin characters, so I've tried some other unicode-compitable fonts. And tried to follow similar issues posted on the forum but without much luck.

So, unicode sequence works, but the same Cyrillic letter typed as usual doesn't:



Is there a way to solve this in my case?

Pages: [1]