PDA

View Full Version : How use unicode in Arabic language?



mismael85
17th November 2010, 23:12
Hi,
I am using clucene library to index and search my text .I am using Arabic text only.
when i retrieve the text from the highlighter i gets it in a wchar_t* pointer.

So, I am using QString::fromWCharArray(wchar_t*) but the text does not appear in Arabic,it appears in strange characters.
I also tried

QString::fromUtf16()
QString::utf8()
QString::data()

can any body help me to display it in right character codec?
Thank you

kiss-o-matic
18th November 2010, 13:08
Not sure but for a Japanese project my main.cpp looks like this.



int main( int argc, char* argv[] )
{
QApplication app( argc, argv );
QTextCodec::setCodecForTr( QTextCodec::codecForName( "UTF-8" ) );
QTextCodec::setCodecForCStrings( QTextCodec::codecForName( "UTF-8" ) );
auction* my_auction = new auction();
my_auction->show();
return app.exec();
}

I seem to recall it not display the characters at all (even though they were simply hard-coded into the source) w/o those two lines... or at least one.