Difference between revisions of "Utf8.escape"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 6: Line 6:
 
<translate>Escape a str to UTF-8 format string. It support several escape format:
 
<translate>Escape a str to UTF-8 format string. It support several escape format:
 
%ddd - which ddd is a decimal number at any length: change Unicode code point to UTF-8 format. %{ddd} - same as %nnn but has bracket around. %uddd - same as %ddd, u stands Unicode %u{ddd} - same as %{ddd} %xhhh - hexadigit version of %ddd %x{hhh} same as %xhhh. %? - '?' stands for any other character: escape this character.</translate>
 
%ddd - which ddd is a decimal number at any length: change Unicode code point to UTF-8 format. %{ddd} - same as %nnn but has bracket around. %uddd - same as %ddd, u stands Unicode %u{ddd} - same as %{ddd} %xhhh - hexadigit version of %ddd %x{hhh} same as %xhhh. %? - '?' stands for any other character: escape this character.</translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = utf8.escape(s)
 
(string) = utf8.escape(s)
 
</source>
 
</source>

Revision as of 14:32, 13 July 2023


Available since: Gideros 2016.06
Class: utf8

Description

Escape a str to UTF-8 format string. It support several escape format: %ddd - which ddd is a decimal number at any length: change Unicode code point to UTF-8 format. %{ddd} - same as %nnn but has bracket around. %uddd - same as %ddd, u stands Unicode %u{ddd} - same as %{ddd} %xhhh - hexadigit version of %ddd %x{hhh} same as %xhhh. %? - '?' stands for any other character: escape this character. <syntaxhighlight lang="lua"> (string) = utf8.escape(s) </source>

Parameters

s: (string)

Return values

Returns (string) escaped string