Skip to content

native2unicode

strings · scripts/strings/native2unicode.m

: str = native2unicode (bytes)
: str = native2unicode (bytes, codepage)

Decode bytes of a named character set into text.

bytes is a numeric vector of byte values (or a char vector read as bytes) and codepage names its encoding; when omitted the system default is used. The result is a char array of Unicode code units (one element per BMP character), with the same orientation as bytes. A unit >= 128 is a wide char, so native2unicode ([194 176], "UTF-8") is 1x1 and double of it is 176.