Contact Us 1-800-596-4880

decodeURIComponent

DataWeave 2.2 is compatible and bundled with Mule 4.2. This version of Mule reached its End of Life on May 2, 2023, when Extended Support ended.

Deployments of new applications to CloudHub that use this version of Mule are no longer allowed. Only in-place updates to applications are permitted.

MuleSoft recommends that you upgrade to the latest version of Mule 4 that is in Standard Support so that your applications run with the latest fixes and security enhancements.

decodeURIComponent(String): String

Decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent or a similar routine.

For an example, see encodeURIComponent.

Parameters

Name Description

text

URI component string.

Example

This example decodes a variety of URI components.

Source

%dw 2.0
import * from dw::core::URL
output application/json
---
{
  "decodeURIComponent": {
    "decodeURIComponent" : decodeURIComponent("%20PATH/%20TO%20/DECODE%20"),
    "decodeURIComponent" : decodeURIComponent("%3B%2C%2F%3F%3A%40%26%3D"),
    "decodeURIComponent" : decodeURIComponent("%2D%5F%2E%21%7E%2A%27%28%29%24"),
  }
}

Output

{
   decodeURIComponent: {
     decodeURIComponent: " PATH/ TO /DECODE ",
     decodeURIComponent: ";,/?:@&=",
    decodeURIComponent: "-_.!~*'()\$"
   }
}