Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Additional JavaScript Global Functions

This topic describes some additional JavaScript global functions you can use.

## escape() and unescape()

The JavaScript `escape()` and `unescape()` functions can be used to encode strings that contain characters with special meanings or outside the ASCII character set.

The `escape()` function encodes a string. This function makes a string portable, so it can be transmitted across any network to any computer that supports ASCII characters.

The function does not encode A-Z, a-z, and 0-9. Additionally, the function encodes all other characters with the exception of: "*", "@", "-", "_", "+", ".", "/".

The `escape()` function maps:

    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~

To:

    %20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E

## encodeURI() and decodeURI()

The `encodeURI()` function is similar to the `escape()` function but encodes fewer characters. Encoding the string:

    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Produces:

    %20!%22#$%25&'()*+,-./0123456789:;%3c=%3e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5b%5c%5d%5e_%60abcdefghijklmnopqrstuvwxyz%7b%7c%7d~

So only the following characters are encoded:

SPACE, "“", "&", "<", ">", "[", "\", "]", "^", "`", "{", "|", "}"

## encodeURIComponent() and decodeURIComponent()

These functions are similar to the`encodeURI()` and `decodeURI()` methods, but they additionally encode and decode the following characters:

, / ? : @ & = + $ #

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.