Skip to content
lsl.devlsl.devLSL Dev

llBase64ToString

function
Function syntax
string llBase64ToString(
  1. string str// Base64-encoded string to decode.
);
Returns
string
Energy
10

Decodes the Base64-encoded string str into a conventional string, interpreting the bytes as a UTF-8 character sequence. Unprintable characters are converted to question marks.

Returns a string that is the Base64 str decoded into a conventional string, interpreting the Base64-encoded bytes as UTF-8 character sequence.

How to use
string result = llBase64ToString("");
  • If the conversion creates any unprintable characters, they are converted to spaces.
  • Converts invalid characters into question marks (’?’).
Example 1
default {
state_entry()
{
string test = llBase64ToString("U2VjcmV0Ok9wZW4=");
llSay(0,test );
}
}
This can be used in Basic Authentication, such as this login:
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
Host: www.example.com
Authorization: Basic U2VjcmV0Ok9wZW4=
Example 3
llBase64ToString("U2VjcmV0Ok9wZW4="); //will return the string "Secret:Open"
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlBase64ToString, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.