Type Function Library utf8.* Return value String Revision Release 2022.3683 Keywords utf8, UTF-8, Unicode, string, escape
Converts a string with escape sequences to a
Format | Description |
---|---|
%n |
n is a numeric Unicode code point |
%{n} |
same as %n but with braces |
%un |
same as %n ; u stands for "Unicode" |
%u{n} |
same as %{n} ; u stands for "Unicode" |
%xh |
hexadecimal number |
%x{h} |
same as %xh but with braces |
%? |
? stands for any other character: escape this character |
local utf8 = require( "plugin.utf8" ) local testStr = utf8.escape( "%9825%32%{20320}%u{22909}%xFF0C%x{4E16}%x754C%32%9825" ) print( testStr ) --> ♡ 你好,世界 ♡