使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
strings.url_decode
strings.url_decode(url_string)
说明
给定一个网址字符串,解码转义字符并处理已编码的 UTF-8 字符。如果解码失败,则返回空字符串。
形参数据类型
STRING
返回类型
STRING
代码示例
示例 1
此示例展示了一个正向测试用例。
strings.url_decode("three%20nine%20four") = "three nine four"
示例 2
此示例展示了空字符串的情况。
strings.url_decode("") // ""
示例 3
此示例展示了非字母字符处理。
strings.url_decode("%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B") // "上海+中國"
示例 4
此示例展示了网址解码示例。
strings.url_decode("http://www.google.com%3Fparam1%3D%22+1+%3E+2+%22%26param2%3D2%3B") // 'http://www.google.com?param1="+1+>+2+"¶m2=2;'
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-29。"],[[["\u003cp\u003e\u003ccode\u003estrings.url_decode\u003c/code\u003e decodes URL strings, handling escape characters and encoded UTF-8 characters, and is supported in Rules and Search.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns an empty string if the URL decoding fails.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a single parameter of the type \u003ccode\u003eSTRING\u003c/code\u003e representing the URL string to decode and it also returns a \u003ccode\u003eSTRING\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt effectively handles non-alphabet characters in addition to standard URL encoding.\u003c/p\u003e\n"]]],[],null,["### strings.url_decode\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.url_decode(url_string)\n\n#### Description\n\nGiven a URL string, decode the escape characters and handle UTF-8 characters that have been encoded. Returns empty string if decoding fails.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\n##### Example 1\n\nThis example shows a positive test case. \n\n strings.url_decode(\"three%20nine%20four\") = \"three nine four\"\n\n##### Example 2\n\nThis example shows an empty string case. \n\n strings.url_decode(\"\") // \"\"\n\n##### Example 3\n\nThis example shows non-alphabet characters handling. \n\n strings.url_decode(\"%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B\") // \"上海+中國\"\n\n##### Example 4\n\nThis example shows a sample URL decoding. \n\n strings.url_decode(\"http://www.google.com%3Fparam1%3D%22+1+%3E+2+%22%26param2%3D2%3B\") // 'http://www.google.com?param1=\"+1+\u003e+2+\"¶m2=2;'"]]