Utf8.escape: Difference between revisions

From GiderosMobile
m Text replacement - "<source" to "<syntaxhighlight"
No edit summary
 
Line 1: Line 1:
__NOTOC__
__NOTOC__
<languages />
'''Available since:''' Gideros 2016.06<br/>
'''<translate>Available since</translate>:''' Gideros 2016.06<br/>
'''Class:''' [[utf8]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/utf8|utf8]]<br/>
 
=== <translate>Description</translate> ===
=== Description ===
<translate>Escape a str to UTF-8 format string. It support several escape format:
Escapes a str to UTF-8 format string.
%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>
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
(string) = utf8.escape(s)
(string) = utf8.escape(s)
</source>
</syntaxhighlight>
=== <translate>Parameters</translate> ===
 
'''s''': (string) <translate></translate> <br/>
It supports several escape format:
=== <translate>Return values</translate> ===
*'''%ddd''' - which ddd is a decimal number at any length: change Unicode code point to UTF-8 format
'''<translate>Returns</translate>''' (string) <translate>escaped string</translate><br/>
*'''%{ddd}''' - same as %ddd 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
 
=== Parameters ===
'''s''': (string) <br/>
 
=== Return values ===
'''Returns''' (string) escaped string<br/>


{{Utf8}}
{{Utf8}}

Latest revision as of 20:43, 1 December 2023

Available since: Gideros 2016.06
Class: utf8

Description

Escapes a str to UTF-8 format string.

(string) = utf8.escape(s)

It supports several escape format:

  • %ddd - which ddd is a decimal number at any length: change Unicode code point to UTF-8 format
  • %{ddd} - same as %ddd 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

Parameters

s: (string)

Return values

Returns (string) escaped string