...
Return the length in bytes of a string, optionally using a given encoding. Allowed encodings include UTF-8, UTF-16, ASCII, CP1252 and ISO-8859-1.
Syntax
byteLength(string, encoding)
Argument | Type | Description |
---|---|---|
string | String | The string to be processed. |
encoding | String | The character encoding to use. |
Examples
byteLength('ab\u1e09', 'UTF-8')
...