-
Notifications
You must be signed in to change notification settings - Fork 0
rife.render.EncodeUnicode
Erik C. Thauvin edited this page Mar 28, 2023
·
3 revisions
Encodes a template value to Unicode escape codes.
<!--v render:rife.render.EncodeUnicode:valueId/-->
{{v render:rife.render.EncodeUnicode:valueId/}}
Template
{{v render:rife.render.EncodeUnicode:sample/}}
Code
template.setAttribute("sample", "This is a test.")
Output
\u0054\u0068\u0069\u0073\u0020\u0069\u0073\u0020\u0061\u0020\u0074\u0065\u0073\u0074\u002E
By default, the rendered data is raw, not template encoded. If you need additional encoding, use the encoding
property.
For example, to encode the rendered data to HTML:
{{v render:rife.render.EncodeUnicode:valueId}}
encoding=html
{{/v}}
The supported additional encoding types are:
html
js
json
unicode
url
xml