utf8.char | Multi Theft Auto: Wiki Skip to content

utf8.char

Client-side
Server-side
Shared

Generates a string representing the character codepoints as arguments.

Syntax

string utf8.char ( int codepoints... )
Required Arguments
  • codepoints...: An variable argument sequence of code points representing the desired unicode characters.

Returns

  • string: value

Returns a string representation of the codepoints passed.

Code Examples

shared

This example separates an input string into single codepoints and then joins these back together, representing the original input string.

local input = "Hello World"
local codepoints = {utf8.byte(input, 1, utf8.len(input))}
local joined = utf8.char(unpack(codepoints))
print(joined) -- Hello World