Example
//simple conversion between utf8 strings and byte arrays
var utfString = "I am an utf8 String!";
var byteArray = siteKiosk.text.utf8Encoding.getBytes(utfString);
//this should log the utfString content
console.log(siteKiosk.text.utf8encoding.getString(byteArray));
Methods
-
<static> getBytes(text) → {Array.<byte>}
-
Converts a string to a byte array.
Parameters:
Name Type Description text
string The text to convert Returns:
The bytes converted from the text string- Type
- Array.<byte>
-
<static> getString(bytes) → {string}
-
Converts a byte array to a string.
Parameters:
Name Type Description bytes
Array.<byte> A byte array to be converted Returns:
The converted string- Type
- string