Hello there,
i’m using cocos 3.17 on Xcode 11. I’m reading the string from a executable called Localized_it but something goes wrong because special character as “ù” are not visualized in the text, there is a little square on a “u” instead. This is how I initialized my label:
Yes. The problem is that the “ù” I use it’s a 8-bit character (the number ASCII is > 127) because it is from a complex text editor. I don’t know how I can display it.
I cannot modify the font, sorry. And I cannot retype the faulty character. In the file.ttf have the character.
The original project it’s cocos 2.2.6 and I made a porting to cocos 3.17. Xcode 11
The character that cannot be visualized in the correct way from the file is “ù”. The strange thing it’s that not all the “ù” in the text have the problem and I discover the reason of this in the HEX file. There are two kind of “ù”:
one “ù”, coded in HEX as 75 CC 80. This is the one with the problem, I think that’s why this part of the text it’s from a complex text editor
other “ù”, coded in HEX as C3 B9, it’s visualize in the correct way, and it’s the same if I type it from the keyboard
I need to see both characters, or with a conversion of those that don’t work, or a label definition that reads both characters, special and simple ones.
Same problem here, two different code for the character ù:
75 CC 80
C3 B9
Both seems UTF-8 encode
With Cocos2d-x 2.2.6 both characters are shown correctly
With Cocos2d-x 3.17.2 the 3 bytes one is not shown correctly, but a square symbol appears next to the “u” (not accented)
This happens also with Arial or Trebuchet MS, only using method setSystemFont avoid this behavior, but I need to use custom font.
I would like to ask if anyone knows how to correctly show both characters, or if there is a converter that can convert the “extended” character to the “reduced” version
Any information can be useful
For example? Do you know if both characters are UTF-8?
If so, why are there two encodings for the same character?
@ele_elion As I can see you use Trebuchet MS.ttf font to initiate your label, but there is no a special character ù in it. Which font do you use, and how can i reprocude it?
thks for your repling. You’re right, I use Trebuchet MS.ttf but I cannot modifiy the font to add the special character ù, sorry. I assume you can use the vanilla version of Trebuchet MS.ttf to reproduce the error.
@coulsonwang, What do you mean by special character ù?
As you saw in my post there are two UTF-8 versions of ù
Actually, Trebuchet MS does not have the character 75 CC 80 while the Arial has it.
Both instead have the character C3 B9
Both of these characters correspond to the accented u “ù”
I would like to ask:
Why in cocos 2.2.6, the Trebuchet MS font reproduced both characters correctly?
In the cocos forum editor if I copy and paste the two variants of ù and then check in the preview, both are encoded into C3 B9.
Here, I need a way to turn 75 CC 80 into C3 B9 programmatically or with an editor