Struct encoding::codec::simpchinese::HZEncodingUnstable [-]  [+] [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 encoder(&self) -> Box<Encoder>

fn decoder(&self) -> Box<Decoder>

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

fn decode(&self, input: &[u8], trap: DecoderTrap) -> Result<String, SendStr>

Derived Implementations

impl Clone for HZEncoding

fn clone(&self) -> HZEncoding

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