Hello,
I want to load a file with unicode:

The file:
Qt Code:
  1. Никифорова Сэндэма Сохондо, Читинская обл.,
  2. сон Москва, Московская обл.,
To copy to clipboard, switch view to plain text mode 

I made this function:
Qt Code:
  1. void loadfromfile(QStringList *list, QString file, bool unicode)
  2. {
  3. QFile File(file);
  4. if (File.open(QFile::ReadOnly))
  5. {
  6. QTextStream in(&File);
  7. if (unicode)
  8. in.setCodec("UTF-16");
  9. QString line;
  10. do
  11. {
  12. line = in.readLine();
  13. if (!line.isEmpty())
  14. list->append(line);
  15. }
  16. while (!line.isNull());
  17. File.close();
  18. }
  19. }
To copy to clipboard, switch view to plain text mode 

Yet when I load the file I am still not seeing the right characters:

Qt Code:
  1. loadfromfile(&list, filename, true);
  2. foreach (s, list)
  3. {
  4. msg.setText(s);
  5. msg.exec();
  6. }
To copy to clipboard, switch view to plain text mode 

Thanks for help.