Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this Page

Table of Contents
2
maxLevel32minLevel
excludeAdditional Resources|Related Links|Related Information

The iconv encode and decode functions can be used to encode/decode strings into/from a specified encoding type. Supported types are UTF-8, UTF-16, and UTF-32. 

encode

Description

Encodes a string in the specified encoding format and returns that as a byte array. 

Syntax


Paste code macro
iconv.encode($String,"<encode type>")


Example
Expression: iconv.encode($msg,"UTF-8")
where $msg contains a string "Hello, World".
Result: "_snaptype_binary_base64": "/v8ASABlAGwAbABvACwAIABXAG8AcgBsAGQ="

decode

Description

Decodes an encoded byte array and returns a string in the specified encoding type. 

Syntax


Paste code macro
iconv.decode(byte array,"<decode type>")


Example
Expression: iconv.decode($msg_encoded,"UTF-8")
where $msg_encoded contains an encoded string.
Result: "Hello, World"

...