Equinox Online Help - Language Reference - A to Z

Home

WebEncode

Applies to
SyntaxWebEncode SourceExpression, Target [, Encoding]
ActionEncodes strings for later use in a web page or URI
ScopeCan be used anywhere
Notes

SourceExpression is a string expression.

Target should be a memo, or string large enough to contain the result.

Encoding is type HTTP percent encoding type, as WebOutput:

  • 4 JSON UTF-8 - see below
  • 3 The string is first base64 encoded, then encoded as 2
  • 2 The string is made safe to insert in a URI: everything is encoded except alphanumerics and -._~
  • 1 The string is assumed to be a URI:everything is encoded except alphanumerics and reserved characters acccording to RFC 3986 section 2.3 !*'();:@&=+$,/?#[]

If Encoding is set to 4, Equinox creates a UTF-8 string compatible with JavaScript Object Notation (JSON). See RFC 4627 section 2.5 for full details; non-printable characters are converted to "\u00XX", and other characters are escaped, for example linefeed becomes "\n".

CategoryWeb Server
See Also WebOutput, WebOutputFile, WebDecode
Example

This example outputs a data uri containing a picture encoded in base64:

memo m, mb

m = MyPicture
WebEncode mid(m, 4), mb, 3
weboutput $ $