Ok, so I have a file. Inside it it has a word (better: a filename) which contains greek characters. This is the code to read the file with the greek word and to add this word to a label:
Qt Code:
  1. char home1 [ 60 ]="/home/alex/check.txt";
  2. char line1 [ 300 ];
  3. FILE *file1 = fopen ( home1, "r" );
  4. fgets ( line1, sizeof line1, file1 );
  5. fclose ( file1 ); //Now `line1` has the word with the greek characters
  6. string name = string(line1);
  7. name.erase(name.length()-1); //Sorting the `name` to delete "\n"
  8. cout << name; // Check: Here `name` is outputed normally, as it should (with the greek characters, so it's OK till now.
  9. QString image_name = QString::fromStdString(name).toUtf8(); //Here must be the evil function that destroys the `name`
  10. ui->image_name->setText(image_name.toUtf8()); //Finally, after the previous function has 'destroyed' the greek letters of `name`, the malformed `name` is put to the lineEdit :(
To copy to clipboard, switch view to plain text mode 
Read the code's comments

Thx in advance for any reply