Enables scripted content fragments to encode data for rendering.
- HtmlAttributeEncode
- HtmlDecode
- HtmlEncode
- HtmlEnsureEncoded
- JavascriptEncode
- UrlDecode
- UrlDecodeFileComponent
- UrlEncode
Methods
HtmlAttributeEncode
Encodes text for use within HTML or XML attributes
Velocity
#set($stringResponse = $core_v2_encoding.HtmlAttributeEncode($text))
JavaScript
var stringResponse = core_v2_encoding.HtmlAttributeEncode(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Raw text | Required |
Returns
String
HtmlDecode
HTML-decodes text
Velocity
#set($stringResponse = $core_v2_encoding.HtmlDecode($html))
JavaScript
var stringResponse = core_v2_encoding.HtmlDecode(html);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | String | HTML-encoded text | Required |
Returns
String
HtmlEncode
HTML-encodes text. Note, most text properties on data returned by the Platform API is already pre-encoded.
Velocity
#set($stringResponse = $core_v2_encoding.HtmlEncode($text))
JavaScript
var stringResponse = core_v2_encoding.HtmlEncode(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Raw text | Required |
Returns
String
HtmlEnsureEncoded
Ensures that text is HTML-encoded.
Velocity
#set($stringResponse = $core_v2_encoding.HtmlEnsureEncoded($text))
JavaScript
var stringResponse = core_v2_encoding.HtmlEnsureEncoded(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Raw text | Required |
Returns
String
JavascriptEncode
JavascriptEncode Overload 1
Escapes text for use within JavaScript string literals or JSON values
Velocity
#set($stringResponse = $core_v2_encoding.JavascriptEncode($text))
JavaScript
var stringResponse = core_v2_encoding.JavascriptEncode(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Raw text | Required |
JavascriptEncode Overload 2
Escapes dates into a format suitable for javascript parsing.
Velocity
#set($stringResponse = $core_v2_encoding.JavascriptEncode($date))
JavaScript
var stringResponse = core_v2_encoding.JavascriptEncode(date);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Source date | Required |
Returns
String
UrlDecode
Decodes text that was URL encoded
Velocity
#set($stringResponse = $core_v2_encoding.UrlDecode($text))
JavaScript
var stringResponse = core_v2_encoding.UrlDecode(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Encoded text | Required |
Returns
String
UrlDecodeFileComponent
Velocity
#set($stringResponse = $core_v2_encoding.UrlDecodeFileComponent($urlToDecode))
JavaScript
var stringResponse = core_v2_encoding.UrlDecodeFileComponent(urlToDecode);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
urlToDecode | String | Url To Decode | Required |
Returns
String
UrlEncode
Encodes text for use within URL query parameters
Velocity
#set($stringResponse = $core_v2_encoding.UrlEncode($text))
JavaScript
var stringResponse = core_v2_encoding.UrlEncode(text);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | String | Raw text | Required |
Returns
String