[Qt-interest] Showing UTF-8 strings
M. Bashir Al-Noimi
mbnoimi at gmx.com
Sat Aug 22 16:17:59 CEST 2009
Thiago Macieira wrote:
> The second paragraph is important. Did you set a codec for C strings? If
> you didn't (and the fact that you got mojibake seems to indicate that),
> QString is applying QString::fromLatin1 to your literal.
>
Yes that's true, I noticed that.
> I went over this yesterday in the "Accented characters and QDom in
> Windows" thread. I urge people to pay attention to other threads that are
> happening in the list. Especially when they are related ("accented
> characters" should have grabbed your attention).
>
Thanks for notifying me, I didn't take attention to this paragraph ;-)
> So, if you have string problems, recompile your app with
> QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII
>
Actually I fixed the problem by using QString::fromUtf8("") as Ellen
said, but I've a question about this problem in my TODO (writing &
reading UTF-8 strings by QFile). So I'll make some researches about
UTF-8 issues before posting my question.
-----
Best Regards
Muhammad Bashir Al-Noimi
My Blog: http://mbnoimi.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090822/57489dfd/attachment.html
More information about the Qt-interest-old
mailing list