Lucee Function Reference
esapiencode()
This Function is deprecated
Deprecated legacy function. Use context-specific functions (e.g., encodeForHTML) instead.
Example
esapiencode(string encodeFor,string string,[boolean canonicalize,[string dialect]]):string
Category
CSS,DN,HTML,JavaScript,ldap,URL,SQL,VBScript,XML
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
| Name | Type | Required | Default Value | Description |
|---|---|---|---|---|
| encodeFor | string | Yes |
The target output context. Valid values: |
|
| string | string | Yes | The raw string to be encoded. | |
| canonicalize | boolean | No | false | If true, simplifies the input (resolving multiple/mixed encoding) before applying the new encoding. This prevents bypass attacks using double-encoding. |
| dialect | string | No |
Required only if encodeFor is 'sql'. Specifies the database syntax: * db2 * mysql_ansi * mysql * oracle |