SFML community forums

Help => General => Topic started by: Bibop on September 09, 2019, 05:50:56 pm

Title: How to read and output text from a cp1251 file
Post by: Bibop on September 09, 2019, 05:50:56 pm
Hello. I try to read character by character the file in the cp1251 encoding and to output by means of sf:: Text, but instead of symbols garbage. What to do?
Title: Re: How to read and output text from a cp1251 file
Post by: eXpl0it3r on September 09, 2019, 10:36:29 pm
Can you post the code within the [code=cpp][/code] tag? Don't really want to download a random archive if I don't have to. ;)
Encoding is a tricky thing, especially in C++. You'll need to make sure you read the text correctly and then convert it correctly to SFML's UTF32 string, which sf::Text uses. But I have no idea how to convert cp1251 to UTF32. :-\