utf8.escape
Client-side
Server-side
Shared
Needs checking
This function was partially migrated from the old wiki. Please review manually:
- Missing section: Formatting
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
Escapes a string to a UTF-8 format string. It supports several escape formats, see the formatting table.
Syntax
utf8.escape ( )Code Examples
server
This example escapes two byte-string literals to UTF-8 format by using the utf8.escape function.
local output = utf8.escape( "%123 %u123 %{123} %u{123} %xABC %x{ABC}" )print( output ) -- { { { { ઼ ઼
local output = utf8.escape( "%%123 %? %d %%u" )print( output ) -- %123 ? d %u