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 - zslevi

Pages: [1]
1
Graphics / Character encoding problem
« on: December 17, 2011, 12:24:24 am »
Thanks, that was it, I somehow missed that for the first reading of the tutorial. However it would be nice to have some utility function initializing the characterset for a certain ISO-8859-x characterset for merely convenience.

2
Graphics / Character encoding problem
« on: December 15, 2011, 10:09:52 pm »
I've tried the font drawing tutorial program, worked without a problem. Then I tried to draw text that uses non-ASCII characters.
I read the text to be displayed from an UTF-8 file.


Code: [Select]

const sf::Uint8* readStringCpp(){
    std::string line("");
    std::ifstream mfile("utf8text.txt");
    if (mfile.is_open()){
        std::getline(mfile,line);    
    }
    return (sf::Uint8*)line.c_str();        
}


Code: [Select]
   
    ...
    sf::Unicode::Text ucText(readStringCpp());    
    sf::String Hello(ucText);
   
    Hello.SetFont(MyFont);
    Hello.SetColor(sf::Color(0, 128, 128));
    Hello.SetPosition(60.f, 120.f);
    ...


And choose Arial Unicode for font.

The standard text to test Hungarian characters is "Árvíztűrő tükörfúrógép". Most of the accented characters of this are already in ASCII, except for Ő and Ű.

What I've got:
http://i.imgur.com/dpHyN.png

As you can see, the non-ASCII characters didn't got displayed.
What did I wrong?

If I use wide character literals, I get the same.

Pages: [1]