04-13-2013 07:06 PM
04-13-2013 08:04 PM
what is the actual character?... I don't think the forum software picked it up right. You might want to try describing it and/or pointing to an online reference.
Try finding the UTF-8 character... if referenced correctly in your app I'd like to believe it should work.
04-14-2013 02:37 AM
The character encoding of your source code is not UTF-8 by default, so you have to prefix any string/character literals to make this all work. So if you want this as a character, try using:
04-14-2013 12:07 PM
04-15-2013 07:33 PM - edited 04-15-2013 07:50 PM
I am sure that there is typo, QChar(L'\u2685') was probably meant to be QChar('\u2685')
Edit: Not true - my mistake, see next.
However I suspect a missing glyph (or two). Try the following:
QString diceTestString = QString::fromUtf8("\u263A \u2685.");
Display this and you will see the smiley face, but the die unicode values all display as the box with the X. .
04-15-2013 07:44 PM
It was not a typo. The string literal format isn't UTF-8 / Unicode by default (unless you explicitly change it), so it actually won't work correctly unless you use that L prefix. The same is actually true for strings like the one in your example, in many cases.
However, I think the Philipk was asking a QML question (without specifying as such), and I gave a C++ answer. He then pasted it into his QML, and obviously got a bunch of errors.
04-15-2013 07:49 PM - edited 04-15-2013 07:49 PM
My mistake, QT/C++ still not a strong suit....
That said, the QString test above does create a String that when displayed, shows a smily face and a box with X. So I think the die symbols are not there.