ISML Function - encodeValue()



Short Description

encodes characters for a target document type

Table of Contents

Product Version


Product To Version


StatusNew Labels


This function can be used to encode the result of an ISML expression. The value of an ISML expression is returned by encodeValue() as a properly encoded string. Non string values are converted to a string before encoding is performed. The convertion is the same like calling the function getValue(). For details about the possible encodings see Cookbook - Encoding.


encodeValue( <value> )
encodeValue( <value>, <encoding> )


The first example shows how to properly encode user entered values if the actual message is printed with encoding="off"

<istext key="welcomeMessage" parameter0="#encodeValue(Profile:FirstName)#" parameter1="#encodeValue(Profile:LastName)#" encoding="off"/>

The next example shows how to specify an encoding (see Cookbook - Encoding for more variants:

#encodeValue(Profile:FirstName, 'json')



value = ISML Expression

Specify the ISML expression to be encoded. Usually, this will be just a template variable. If the expression result is not of type string then this value will be converted before encoding takes place. Conversion is done in the same way as getValue(value).


encoding = ISML Expression

Optional parameter.

If the parameter is not set or null the encoding matching the current template type is used. Otherwise the encoding must be string with encoding identifiers, like html, javascript. For more details on how to use encoding types supported by Intershop or add a custom encoding type see: Cookbook - Encoding.

Reference - ISML Functions


The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

The Intershop Customer Support website uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties.

Further information on privacy can be found in the Intershop Privacy Policy and Legal Notice.
Customer Support
Knowledge Base
Product Resources