gossamer/text_decoder
Types
Represents a decoder for a specific text encoding, allowing you to convert binary data into a string given the encoding.
pub type TextDecoder
Values
pub fn decode(input: array_buffer.ArrayBuffer) -> String
Turns binary data, often in the form of a Uint8Array, into a string given the encoding.
pub fn decode_chunk(
decoder: TextDecoder,
input: array_buffer.ArrayBuffer,
) -> Result(String, String)
pub fn decode_with(
input: array_buffer.ArrayBuffer,
label: String,
options: List(text_decoder_option.TextDecoderOption),
) -> Result(String, String)
pub fn flush(decoder: TextDecoder) -> Result(String, String)
pub fn is_fatal(decoder: TextDecoder) -> Bool
Returns true if error mode is “fatal”, otherwise false.
pub fn is_ignore_bom(decoder: TextDecoder) -> Bool
Returns the value of ignore BOM.
pub fn new() -> TextDecoder
pub fn new_with(
label: String,
options: List(text_decoder_option.TextDecoderOption),
) -> Result(TextDecoder, String)