[Solved] UTF-8 Files and CEGUI::String
Posted: Sun May 22, 2005 20:32
Hello,
I have a problem with files containing UTF-8 encoded text and CEGUI : as i have to use std::ifstream and std;;string, I lose all accentuated characters ...
I also tried with std::wifstream and std::wstring, but there it seems to be not way to convert wifstream to CEGUI::String ... so i have no ideas any more
If someone could help me ...
I have a problem with files containing UTF-8 encoded text and CEGUI : as i have to use std::ifstream and std;;string, I lose all accentuated characters ...
Code: Select all
std::ifstream fTextIntro( "intro_text.txt" );
CEGUI::String strTextIntro;
std::string strLine;
if( fTextIntro )
{
while( std::getline( fTextIntro, strLine ) )
{
strTextIntro += strLine;
strTextIntro += '\n';
}
}
CEGUI::MultiLineEditbox* editbox = dynamic_cast<CEGUI::MultiLineEditbox*>( mSheet->getChild( (CEGUI::utf8*) "TextIntro" ) );
editbox->setText( strTextIntro );I also tried with std::wifstream and std::wstring, but there it seems to be not way to convert wifstream to CEGUI::String ... so i have no ideas any more
If someone could help me ...