Skip to content

Instantly share code, notes, and snippets.

@meh
Created October 17, 2016 01:14
Show Gist options
  • Save meh/a96d1758be34ce21f4bb16febfadca78 to your computer and use it in GitHub Desktop.
Save meh/a96d1758be34ce21f4bb16febfadca78 to your computer and use it in GitHub Desktop.
named!(SCS<Charset>,
switch!(take!(1),
b"<" => value!(Charset::UserPreferred) |
b"0" => value!(charset::DEC::Graphic.into()) |
b"9" => value!(charset::NRCS::FrenchCanadian.into()) |
b"Q" => value!(charset::NRCS::FrenchCanadian.into()) |
b"`" => value!(charset::NRCS::Norwegian.into()) |
b"E" => value!(charset::NRCS::Norwegian.into()) |
b"6" => value!(charset::NRCS::Norwegian.into()) |
b"5" => value!(charset::NRCS::Finnish.into()) |
b"C" => value!(charset::NRCS::Finnish.into()) |
b"7" => value!(charset::NRCS::Swedish.into()) |
b"H" => value!(charset::NRCS::Swedish.into()) |
b"A" => value!(charset::ISO::Latin1.into()) |
b"B" => value!(charset::ISO::Latin2.into()) |
b"F" => value!(charset::ISO::Greek.into()) |
b"H" => value!(charset::ISO::Hebrew.into()) |
b"M" => value!(charset::ISO::Latin5.into()) |
b"L" => value!(charset::ISO::Cyrillic.into()) |
b"\"" => switch!(take!(1),
b"?" => value!(charset::DEC::Greek.into()) |
b"4" => value!(charset::DEC::Hebrew.into()) |
b">" => value!(charset::NRCS::Greek.into())) |
b"&" => switch!(take(1),
b"4" => value!(charset::DEC::Cyrillic.into()) |
b"5" => value!(charset::NRCS::Russian)) |
b"%" => switch!(take!(1),
b"5" => value!(charset::DEC::Supplemental.into()) |
b"0" => value!(charset::DEC::Turkish.into()) |
b"6" => value!(charset::NRCS::Portuguese.into()) |
b"=" => value!(charset::NRCS::Hebrew.into()) |
b"2" => value!(charset::NRCS::Turkish.into()) |
b"3" => value!(charset::NRCS::SCS.into()))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment