Re: Retrieve string codec
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?
Re: Retrieve string codec
Quote:
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
Code:
LineEdit->setText("€");
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:
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. :)
Re: Retrieve string codec
Hi, you can also try
Code:
LineEdit->setText(trUtf8("€"));
which works perfectly fine for me