Encoding
toUtf8Bytes
Returns the UTF-8 byte representation of str
.
If form
is specified, the string is normalized.
Parameters
Parameter | Type | Description |
---|---|---|
str | string | The string to convert. |
form ? | UnicodeNormalizationForm | The normalization form to use. |
Returns
Uint8Array
The UTF-8 byte representation.
Throws
If the UTF-8 conversion fails.
Source
Was this page helpful?