I was working on a side project a few weeks ago and came across a frustrating bug involving the £ sign.
The project was a quick clone of Deal or No Deal, and the amounts are in GBP. The amounts are set randomly by a script, but when I add the cash manually this is what is shown:
The script adds the numbers randomly from a table and concatenates a ‘£’ in front of the amount. However, nothing is displayed on the TextLabel but the text is there but with a “missing character” symbol or whatever it is.
I’m not actively working on this game anymore but the bug is quite annoying to people in the UK who might want to use the £ symbol.
This bug also occurs with any kind of GUI object, Surface, Billboard, Screen etc.
If I remember correctly, scripts don’t support UTF8 at all. All UTF8 characters become the unknown character you see in the Text property, and I believe this is only visible after you close and open the editor.
That didn’t work when I tried it. Neither did “\163”. Roblox puts the character 194, or Â, in front of £ in the text to display it, so putting £ should work.
This seems to work for me, I’m a bit confused atm why it wants the 194 char there specifically though. If any character I’d expect something more predictable there rather than a seemingly random value.
It is just the way Roblox GUI objects encode text. Both of those characters are outside of the printable ASCII character range (32-127) so they are “safe” to use for special encoding purposes and extend the range of characters past 255. Roblox Studio recognizes that you want to have the encoded version when you put it in a field in the properties, but it assumes you know what you are doing in the script editor. Some users may use specific characters for special behavior in their scripts, so inserting an extra character just for the sake of encoding for GUI text objects alone would be unexpected behavior in many cases.
Right, so the pound sign is U+00A3 in unicode, but in UTF-8 it would map to C2A3 as a two-byte sequence rather than one byte. C2 = 194, A3 = 163.
163 on its own does not belong to any character in UTF-8, so if you just fill out 163 on its own it will result in a non-printable character. The 194 byte is associated with a 2-byte character, so if you put 194 followed by a 163 it will be interpreted as the correct two-byte character.