“LlUnescapeURL”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: string llUnescapeURL( string url ); |参数= 参数: •…”) |
(没有差异)
|
2020年7月13日 (一) 10:22的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: string llUnescapeURL( string url ); |
| 参数:
•字符串url–一个字符串(最好是有效的和转义的url)。 此函数类似于许多其他语言中的函数 |
| 返回值:返回一个字符串,该字符串是url的未转义/未编码版本,将“%20”替换为空格等。 |
| 注意事项 |
|---|
| UTF-8字节编码的十六进制编码表示是访问非ASCII7字符(Unicode字符)的唯一支持方式。
不支持将Unicode解码为“%u”##################。 “+”字符不解码为空格。 |
| 示例 |
|---|
示例1
string str = "http://wiki.secondlife.com/wiki/LSL Portal";
default
{
state_entry()
{
llOwnerSay("Plain string:\n\t" + str);
// output: "http://wiki.secondlife.com/wiki/LSL Portal"
llOwnerSay("Escaped string:\n\t" + llEscapeURL(str));
// output: "http%3A%2F%2Fwiki%2Esecondlife%2Ecom%2Fwiki%2FLSL%20Portal"
llOwnerSay("Escaped string unescaped again:\n\t" + llUnescapeURL( llEscapeURL(str) ));
// output: "http://wiki.secondlife.com/wiki/LSL Portal"
// because escaping and unescaping are exact opposite
// and unescaping an escaped string returns the original
// For readability's sake it would make more sense to do:
llOwnerSay("For readability's sake:\n\t" + "http://wiki.secondlife.com/wiki/" + llEscapeURL("LSL Portal"));
// output: "http://wiki.secondlife.com/wiki/LSL%20Portal"
}
}
|
| 相关函数 |
|---|
| llEscapeURL–与llUnescapeURL相反 |
| 相关事件 |
|---|