Quantcast
WoWInterface - View Single Post - Unicode symbols in a string within quotes
View Single Post
07-06-20, 06:01 AM   #1
Clayent
A Murloc Raider
Join Date: Jul 2020
Posts: 4
Question Unicode symbols in a string within quotes

Hi.
How can I put a unicode symbol in a string within quotes? For example, if I have this code in .lua:
['MAIN_TAB'] = "Some text and <unicode symbol of rightwards arrow>"
Then in game I will see this - "Some text and →".

I've found this article - https://stackoverflow.com/questions/...-symbol-in-lua
The solution is: "The UTF-8 encoding of a Unicode character can be inserted in a literal string with the escape sequence \u{XXX} (note the mandatory enclosing brackets), where XXX is a sequence of one or more hexadecimal digits representing the character code point."

I've tried this - ['MAIN_TAB'] = "Some text and \u{2192}" and this - ['MAIN_TAB'] = "Some text and \u2192".
And it is not helpful.

PS: rightwards arrow code is here - https://www.fileformat.info/info/uni...2192/index.htm
  Reply With Quote