charsetDecode

Converts as string to a binary representation.

charsetDecode(String, encoding) → returns binary

charsetDecode Argument Reference

String string
Required

A string containing data to encode in binary format.

encoding string
Required

A string specifying encoding of the input data.
Values:
  • utf-8
  • iso-8859-1
  • windows-1252
  • us-ascii
  • shift_jis
  • iso-2022-jp
  • euc-jp
  • euc-kr
  • big5
  • euc-cn
  • utf-16

Examples sample code invoking the charsetDecode function


Decode a string using utf-8 back into binary encoding of the string

use charsetDecode to decode with utf-8

charsetDecode('string','utf-8');

Expected Result: [BINARY]


Decode a string using us-ascii back into binary encoding of the string

use charsetDecode to decode with us-ascii

charsetDecode('string','us-ascii');

Expected Result: [BINARY]


Fork me on GitHub