Hi,

I have to read unicode character of Indian Languages(Hindi/Telugu etc) from a file,
then i have to convert it in to the QString of actual text/font of that language.

While we are passing unicode manually it's working fine like following :

Qt Code:
  1. QString str = QString::fromStdWString(L"\u0926\u0947\u0935\u0928\u093e\u0970");
  2. qDebug() << str; // It's printing actual font;
To copy to clipboard, switch view to plain text mode 


But while we are trying to read unicode from file then not able to move ahead,
our requirement is like that :


Qt Code:
  1. QString fileText;
  2. QFile file(argv[1]); //argv[1] is file name we are passing on command line.
  3. QTextStream out(&file);
  4. if(file.open(QIODevice::ReadOnly | QIODevice::Text))
  5. {
  6. fileText=out.readAll();
  7. }
  8. file.close();
  9. qDebug()<<"data in the file:\n"<<fileText; // printing unicode character as it is in file;
  10.  
  11. // PROBLEM
  12.  
  13. std::wstring temp_text = fileText.toStdWString();
  14. QString test = QString::fromStdWString(temp_text); // Not Working
  15.  
  16. qDebug()<<"text:"<<test; // It's printing unicode character as, conversion not happening
To copy to clipboard, switch view to plain text mode 

My doubt is on fromStdWString() , In first case we are passing "L", what is this ?
And how to paas this "L" in fromStdWString(temp_text);

Thanks