Originally Posted by
jpn
Perhaps your source file is not saved in UTF-8.
ICU is able to detect encoding but it's probably overkill for what you're trying to do. What are you actually trying to do?
Sorry, I'm late, I always forgot to reply...
anyway I found a "solution" for this, but I don't know if it is "so fine".
I was trying to put an Euro symbol ( € ) in a QLineEdit, but if inserted by
LineEdit->setText("€");
LineEdit->setText("€");
To copy to clipboard, switch view to plain text mode
results in a square (unknown char). But since QtDesigner is able to put an Euro char in the QLineEdit, so I "asked" him how it was doing. Then watching the resulting ui file, I saw it wrote something like the following:
QString EURO=QApplication::translate("frmmain", "\342\202\254", 0, QApplication::UnicodeUTF8);
To copy to clipboard, switch view to plain text mode
Eventually I used this code and it works, but actually I don't know exactly what it means, so if someone could explain it, it would be great. The end.
Bookmarks