Unofficial LSL Reference

[[functions:llchar]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Function: llChar

string llChar(integer code)

Given a Unicode codepoint (or ASCII code), return the corresponding Unicode character.

Parameters

code

The Unicode codepoint of the character to return.

Return value

The Unicode character corresponding to the given codepoint, or a question mark "?" if the code was negative.

Notes

  • In Mono, the returned string may not be exactly 1 character long in the following circumstances:
    • An input code of 0 (zero) returns an empty string.
    • An input code between 55296 (0xD800) and 57343 (0xDFFF) inclusive returns the three-character string "???".
    • An input code of 65534 (0xFFFE) also returns the three-character string "???".
    • An input code between 1,114,112 (0x110000) and 2,097,151 (0x1FFFFF) inclusive returns the four-character string "????".
    • An input code between 2,097,152 (0x200000) and 67,108,863 (0x3FFFFFF) inclusive returns the five-character string "?????".
    • An input code between 67,108,864 (0x4000000) and 2,147,483,647 (0x7FFFFFFF) inclusive returns the six-character string "??????".
    • All other codes return a single-character string.
  • In LSO, an input code of 0 (zero) returns an empty string. All other combinations return a string of length 1. LSO allows invalid Unicode characters like codepoints 0xD800, 0xFFFE, 0x110000.

Short examples

string s = llChar(65); // sets s to the letter "A"
llOwnerSay(llChar(9829)); // displays a heart, "♥"
llOwnerSay(llChar(0x2665)); // same

See also