Skip to content

llChar

string llChar(integer value)

Returns a single character string that is the representation of the unicode value.

Parameters
value (integer)
Unicode value to convert into a string.

This function returns a single character string generated from the character at the indicated UTF-32 codepoint. If the value is negative, the codepoint has no valid single-character UTF-16 representation (such as a part of a surrogate pair), or is outside the defined range, the Unicode replacement character ”�” (0xFFFD) is returned. If the value is 0, an empty string is returned.

default
{
touch_start(integer total_number)
{
string test_string = "The quick brown fox jumped over the lazy dog";
list test_list = [];
string test_string2 = "";
integer index;
integer ord;
for (index = 0; index < llStringLength(test_string); ++index)
{
ord = llOrd(test_string, index);
test_list = test_list + [ ord ];
}
string char;
for (index = 0; index < llGetListLength(test_list); ++index)
{
ord = llList2Integer(test_list, index);
char = llChar(ord);
test_string2 = test_string2 + char;
}
llSay(0, "\"" + test_string + "\" -> [" +
llDumpList2String(test_list, ", ") + "] -> \"" + test_string2 + "\"");
}
}

This example demonstrates the inverse relationship between llChar and llOrd. It converts a string to a list of Unicode codepoints, then reconstructs the original string using llChar.