Skip to main content

decode_character_string

Function decode_character_string 

Source
pub fn decode_character_string(data: &[u8]) -> Result<String, Error>
Expand description

Decode a character string from content bytes.

The first byte is the charset identifier. Supported charsets:

  • 0 (UTF-8)
  • 4 (UCS-2, big-endian)
  • 5 (ISO-8859-1)

Charsets 1 (DBCS/JIS X 0201), 2 (JIS C 6226), and 3 (UCS-4) return an error.