pub enum EncodingLabel {
Show 229 variants
Unknown,
_866,
Ansi_u_x3_d_4_1968,
Arabic,
Ascii,
Asmo_708,
Big5,
Big5_hkscs,
Chinese,
Cn_big5,
Cp1250,
Cp1251,
Cp1252,
Cp1253,
Cp1254,
Cp1255,
Cp1256,
Cp1257,
Cp1258,
Cp819,
Cp866,
Csbig5,
Cseuckr,
Cseucpkdfmtjapanese,
Csgb2312,
Csibm866,
Csiso2022jp,
Csiso2022kr,
Csiso58gb231280,
Csiso88596e,
Csiso88596i,
Csiso88598e,
Csiso88598i,
Csisolatin1,
Csisolatin2,
Csisolatin3,
Csisolatin4,
Csisolatin5,
Csisolatin6,
Csisolatin9,
Csisolatinarabic,
Csisolatincyrillic,
Csisolatingreek,
Csisolatinhebrew,
Cskoi8r,
Csksc56011987,
Csmacintosh,
Csshiftjis,
Csunicode,
Cyrillic,
Dos_874,
Ecma_114,
Ecma_118,
Elot_u_928,
Euc_jp,
Euc_kr,
Gb18030,
Gb2312,
Gb_u_2312,
Gb_u_2312_80,
Gbk,
Greek,
Greek8,
Hebrew,
Hz_gb_2312,
Ibm819,
Ibm866,
Iso_10646_ucs_2,
Iso_2022_cn,
Iso_2022_cn_ext,
Iso_2022_jp,
Iso_2022_kr,
Iso_8859_1,
Iso_8859_10,
Iso_8859_11,
Iso_8859_13,
Iso_8859_14,
Iso_8859_15,
Iso_8859_16,
Iso_8859_2,
Iso_8859_3,
Iso_8859_4,
Iso_8859_5,
Iso_8859_6,
Iso_8859_6_e,
Iso_8859_6_i,
Iso_8859_7,
Iso_8859_8,
Iso_8859_8_e,
Iso_8859_8_i,
Iso_8859_9,
Iso_ir_100,
Iso_ir_101,
Iso_ir_109,
Iso_ir_110,
Iso_ir_126,
Iso_ir_127,
Iso_ir_138,
Iso_ir_144,
Iso_ir_148,
Iso_ir_149,
Iso_ir_157,
Iso_ir_58,
Iso8859_1,
Iso8859_10,
Iso8859_11,
Iso8859_13,
Iso8859_14,
Iso8859_15,
Iso8859_2,
Iso8859_3,
Iso8859_4,
Iso8859_5,
Iso8859_6,
Iso8859_7,
Iso8859_8,
Iso8859_9,
Iso88591,
Iso885910,
Iso885911,
Iso885913,
Iso885914,
Iso885915,
Iso88592,
Iso88593,
Iso88594,
Iso88595,
Iso88596,
Iso88597,
Iso88598,
Iso88599,
Iso_u_8859_1,
Iso_u_8859_15,
Iso_u_8859_1_c_1987,
Iso_u_8859_2,
Iso_u_8859_2_c_1987,
Iso_u_8859_3,
Iso_u_8859_3_c_1988,
Iso_u_8859_4,
Iso_u_8859_4_c_1988,
Iso_u_8859_5,
Iso_u_8859_5_c_1988,
Iso_u_8859_6,
Iso_u_8859_6_c_1987,
Iso_u_8859_7,
Iso_u_8859_7_c_1987,
Iso_u_8859_8,
Iso_u_8859_8_c_1988,
Iso_u_8859_9,
Iso_u_8859_9_c_1989,
Koi,
Koi8,
Koi8_r,
Koi8_ru,
Koi8_u,
Koi8_u_r,
Korean,
Ks_u_c_u_5601_1987,
Ks_u_c_u_5601_1989,
Ksc5601,
Ksc_u_5601,
L1,
L2,
L3,
L4,
L5,
L6,
L9,
Latin1,
Latin2,
Latin3,
Latin4,
Latin5,
Latin6,
Logical,
Mac,
Macintosh,
Ms932,
Ms_u_kanji,
Replacement,
Shift_jis,
Shift_u_jis,
Sjis,
Sun_u_eu_u_greek,
Tis_620,
Ucs_2,
Unicode,
Unicode_1_1_utf_8,
Unicode11utf8,
Unicode20utf8,
Unicodefeff,
Unicodefffe,
Us_ascii,
Utf_16,
Utf_16be,
Utf_16le,
Utf_8,
Utf8,
Visual,
Windows_1250,
Windows_1251,
Windows_1252,
Windows_1253,
Windows_1254,
Windows_1255,
Windows_1256,
Windows_1257,
Windows_1258,
Windows_31j,
Windows_874,
Windows_949,
X_cp1250,
X_cp1251,
X_cp1252,
X_cp1253,
X_cp1254,
X_cp1255,
X_cp1256,
X_cp1257,
X_cp1258,
X_euc_jp,
X_gbk,
X_mac_cyrillic,
X_mac_roman,
X_mac_ukrainian,
X_sjis,
X_unicode20utf8,
X_user_defined,
X_x_big5,
}Expand description
Every label in the Encoding Standard, matched ASCII case-insensitively.
A label names an encoding, and an encoding has several labels. EncodingLabel::compact gives the shortest label of an encoding, so compare compacted labels to compare encodings.
Variant names spell their label with - written as _. The labels that hold _, . or
: cannot be spelled that way, so they mangle those bytes to _u_, _d_ and _c_ and
carry an explicit #[atom].
Variants§
Unknown
_866
Ansi_u_x3_d_4_1968
Arabic
Ascii
Asmo_708
Big5
Big5_hkscs
Chinese
Cn_big5
Cp1250
Cp1251
Cp1252
Cp1253
Cp1254
Cp1255
Cp1256
Cp1257
Cp1258
Cp819
Cp866
Csbig5
Cseuckr
Cseucpkdfmtjapanese
Csgb2312
Csibm866
Csiso2022jp
Csiso2022kr
Csiso58gb231280
Csiso88596e
Csiso88596i
Csiso88598e
Csiso88598i
Csisolatin1
Csisolatin2
Csisolatin3
Csisolatin4
Csisolatin5
Csisolatin6
Csisolatin9
Csisolatinarabic
Csisolatincyrillic
Csisolatingreek
Csisolatinhebrew
Cskoi8r
Csksc56011987
Csmacintosh
Csshiftjis
Csunicode
Cyrillic
Dos_874
Ecma_114
Ecma_118
Elot_u_928
Euc_jp
Euc_kr
Gb18030
Gb2312
Gb_u_2312
Gb_u_2312_80
Gbk
Greek
Greek8
Hebrew
Hz_gb_2312
Ibm819
Ibm866
Iso_10646_ucs_2
Iso_2022_cn
Iso_2022_cn_ext
Iso_2022_jp
Iso_2022_kr
Iso_8859_1
Iso_8859_10
Iso_8859_11
Iso_8859_13
Iso_8859_14
Iso_8859_15
Iso_8859_16
Iso_8859_2
Iso_8859_3
Iso_8859_4
Iso_8859_5
Iso_8859_6
Iso_8859_6_e
Iso_8859_6_i
Iso_8859_7
Iso_8859_8
Iso_8859_8_e
Iso_8859_8_i
Iso_8859_9
Iso_ir_100
Iso_ir_101
Iso_ir_109
Iso_ir_110
Iso_ir_126
Iso_ir_127
Iso_ir_138
Iso_ir_144
Iso_ir_148
Iso_ir_149
Iso_ir_157
Iso_ir_58
Iso8859_1
Iso8859_10
Iso8859_11
Iso8859_13
Iso8859_14
Iso8859_15
Iso8859_2
Iso8859_3
Iso8859_4
Iso8859_5
Iso8859_6
Iso8859_7
Iso8859_8
Iso8859_9
Iso88591
Iso885910
Iso885911
Iso885913
Iso885914
Iso885915
Iso88592
Iso88593
Iso88594
Iso88595
Iso88596
Iso88597
Iso88598
Iso88599
Iso_u_8859_1
Iso_u_8859_15
Iso_u_8859_1_c_1987
Iso_u_8859_2
Iso_u_8859_2_c_1987
Iso_u_8859_3
Iso_u_8859_3_c_1988
Iso_u_8859_4
Iso_u_8859_4_c_1988
Iso_u_8859_5
Iso_u_8859_5_c_1988
Iso_u_8859_6
Iso_u_8859_6_c_1987
Iso_u_8859_7
Iso_u_8859_7_c_1987
Iso_u_8859_8
Iso_u_8859_8_c_1988
Iso_u_8859_9
Iso_u_8859_9_c_1989
Koi
Koi8
Koi8_r
Koi8_ru
Koi8_u
Koi8_u_r
Korean
Ks_u_c_u_5601_1987
Ks_u_c_u_5601_1989
Ksc5601
Ksc_u_5601
L1
L2
L3
L4
L5
L6
L9
Latin1
Latin2
Latin3
Latin4
Latin5
Latin6
Logical
Mac
Macintosh
Ms932
Ms_u_kanji
Replacement
Shift_jis
Shift_u_jis
Sjis
Sun_u_eu_u_greek
Tis_620
Ucs_2
Unicode
Unicode_1_1_utf_8
Unicode11utf8
Unicode20utf8
Unicodefeff
Unicodefffe
Us_ascii
Utf_16
Utf_16be
Utf_16le
Utf_8
Utf8
Visual
Windows_1250
Windows_1251
Windows_1252
Windows_1253
Windows_1254
Windows_1255
Windows_1256
Windows_1257
Windows_1258
Windows_31j
Windows_874
Windows_949
X_cp1250
X_cp1251
X_cp1252
X_cp1253
X_cp1254
X_cp1255
X_cp1256
X_cp1257
X_cp1258
X_euc_jp
X_gbk
X_mac_cyrillic
X_mac_roman
X_mac_ukrainian
X_sjis
X_unicode20utf8
X_user_defined
X_x_big5
Implementations§
Source§impl EncodingLabel
impl EncodingLabel
Sourcepub fn from_label(label: &str) -> Self
pub fn from_label(label: &str) -> Self
Gives the label for label, as get an encoding does: remove leading and trailing ASCII
whitespace, then match ASCII case-insensitively.
assert_eq!(EncodingLabel::from_label(" \tGBK\n").to_str(), "gbk");
assert_eq!(EncodingLabel::from_label("not-a-charset"), EncodingLabel::Unknown);Sourcepub fn compact(self) -> Self
pub fn compact(self) -> Self
Gives the shortest label naming the same encoding, or itself when it is already the shortest.
Gives EncodingLabel::Unknown for a label a @charset rule gains nothing from: an unknown
label, and the labels of encodings that determining the fallback encoding resolves to UTF-8.
Such a rule has no effect and you can remove it.
assert_eq!(EncodingLabel::from_label("ISO-8859-1").compact().to_str(), "l1");
assert_eq!(EncodingLabel::from_label("gbk").compact().to_str(), "gbk");
assert_eq!(EncodingLabel::from_label("utf-16").compact(), EncodingLabel::Unknown);Trait Implementations§
Source§impl AtomSet for EncodingLabel
impl AtomSet for EncodingLabel
Source§fn from_str(s: &str) -> Self
fn from_str(s: &str) -> Self
Source§fn to_str(self) -> &'static str
fn to_str(self) -> &'static str
Source§fn len(&self) -> u32
fn len(&self) -> u32
Source§impl Clone for EncodingLabel
impl Clone for EncodingLabel
Source§fn clone(&self) -> EncodingLabel
fn clone(&self) -> EncodingLabel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodingLabel
impl Debug for EncodingLabel
Source§impl Default for EncodingLabel
impl Default for EncodingLabel
Source§fn default() -> EncodingLabel
fn default() -> EncodingLabel
Source§impl PartialEq for EncodingLabel
impl PartialEq for EncodingLabel
Source§fn eq(&self, other: &EncodingLabel) -> bool
fn eq(&self, other: &EncodingLabel) -> bool
self and other values to be equal, and is used by ==.impl Copy for EncodingLabel
impl Eq for EncodingLabel
impl StructuralPartialEq for EncodingLabel
Auto Trait Implementations§
impl Freeze for EncodingLabel
impl RefUnwindSafe for EncodingLabel
impl Send for EncodingLabel
impl Sync for EncodingLabel
impl Unpin for EncodingLabel
impl UnsafeUnpin for EncodingLabel
impl UnwindSafe for EncodingLabel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynAtomSet for T
impl<T> DynAtomSet for T
Source§fn str_to_bits(&self, keyword: &str) -> u32
fn str_to_bits(&self, keyword: &str) -> u32
Source§fn bits_to_str(&self, bits: u32) -> &'static str
fn bits_to_str(&self, bits: u32) -> &'static str
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more