utils/utf8
Documentation
- source: utils/utf8.ts
Overview
Classes
UTF8
encode()
Encodes the input (either a standard JavaScript string or a raw byte array) into a UTF-8 encoded string representation.
tsstatic encode(input: any): string;
Parameter Type Description inputanyThe text string to be encoded, or a byte array to convert to its string representation. Returns
- Type:
string- Description: The resulting UTF-8 encoded string.
decode()
Decodes the input (either a UTF-8 encoded string or a raw byte array) back into a standard JavaScript string.
tsstatic decode(input: any): string;
Parameter Type Description inputanyThe UTF-8 encoded string or byte array to be decoded. Returns
- Type:
string- Description: The resulting standard decoded string.
bytesToString()
Decodes a specific segment of a raw byte array into a standard string using UTF-8 encoding.
tsstatic bytesToString(bytes: any, offset: number, length: number): string;
Parameter Type Description bytesanyThe raw byte array containing the UTF-8 data. offsetnumberThe starting index (inclusive) from which to begin decoding. lengthnumberThe number of bytes to decode starting from the offset. Returns
- Type:
string- Description: The decoded string segment.
