Struct encoding::codec::simpchinese::GB18030EncodingUnstable [-]  [+] [src]

pub struct GB18030Encoding;

GB 18030-2005.

This 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.

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":

Trait Implementations

impl Encoding for GB18030Encoding

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 GB18030Encoding

fn clone(&self) -> GB18030Encoding

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