LlUnescapeURL

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
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相反
相关事件