Struct encoding::codec::simpchinese::HZEncoding [] [src]

pub struct HZEncoding;

HZ. (RFC 1843)

This is a simplified Chinese encoding based on GB 2312. It bears a resemblance to ISO 2022 encodings in such that the printable escape sequences ~{ and ~} are used to delimit a sequence of 7-bit-safe GB 2312 sequences. For the comparison, they are equivalent to ISO-2022-CN escape sequences ESC $ ) A and ESC ( B. Additional escape sequences ~~ (for a literal ~) and ~\n (ignored) are also supported.

Trait Implementations

impl Encoding for HZEncoding

fn name(&self) -> &'static str

fn whatwg_name(&self) -> Option<&'static str>

fn raw_encoder(&self) -> Box<RawEncoder>

fn raw_decoder(&self) -> Box<RawDecoder>

fn encode(&self, input: &str, trap: EncoderTrap) -> Result<Vec<u8>, Cow<'static, str>>

fn encode_to(&self, input: &str, trap: EncoderTrap, ret: &mut ByteWriter) -> Result<(), Cow<'static, str>>

fn decode(&self, input: &[u8], trap: DecoderTrap) -> Result<String, Cow<'static, str>>

fn decode_to(&self, input: &[u8], trap: DecoderTrap, ret: &mut StringWriter) -> Result<(), Cow<'static, str>>

Derived Implementations

impl Copy for HZEncoding

impl Clone for HZEncoding

fn clone(&self) -> HZEncoding

fn clone_from(&mut self, source: &Self)