Unicode symbols in a string within quotes - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
07-06-20, 06:01 AM   #1
A Murloc Raider
Join Date: Jul 2020
Posts: 4
Question Unicode symbols in a string within quotes

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

WoWInterface » Developer Discussions » Lua/XML Help » Unicode symbols in a string within quotes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off