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

pub struct GBEncoding<T> {
    // some fields omitted
}

GBK and GB 18030-2005.

The original GBK 1.0 region spans [81-FE] [40-7E 80-FE], and is derived from several different revisions of a family of encodings named "GBK":

GB 18030-2005 is a simplified Chinese encoding which extends GBK 1.0 to a pan-Unicode encoding. It assigns four-byte sequences to every Unicode codepoint missing from the GBK area, lexicographically ordered with occasional "gaps" for codepoints in the GBK area. Due to this compatibility decision, there is no simple relationship between these four-byte sequences and Unicode codepoints, though there exists a relatively simple mapping algorithm with a small lookup table.

Specialization

This type is specialized with GBType T, which should be either GBK or GB18030.

Trait Implementations

impl<T: GBType> Encoding for GBEncoding<T>

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<T: Copy> Copy for GBEncoding<T>

impl<T: Clone> Clone for GBEncoding<T>

fn clone(&self) -> GBEncoding<T>

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