StringToByteArray
StringToByteArray["string"]
returns a byte array corresponding to the UTF-8 encoding of the specified string.
StringToByteArray["string","encoding"]
uses the specified character encoding.
Details
- The result of StringToByteArray["string",…] is a ByteArray object.
- The value of "encoding" can be any member of $CharacterEncodings, with the exception of "Unicode" or "ISO10646-1".
- StringToByteArray["string","encoding"] requires that all characters in "string" have a character code in "encoding".
Examples
open allclose allBasic Examples (2)
Scope (2)
Properties & Relations (6)
Possible Issues (2)
See Also
ByteArrayToString ToCharacterCode $CharacterEncodings ExportByteArray ByteArray String
Related Guides
Introduced in 2017
(11.2)