Skip to content

Commit

Permalink
Add some extra unicode to CP850 conversions.
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Jul 15, 2023
1 parent 9f839c1 commit 1445805
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/vgaconsole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ impl ConsoleInner {
// This fixed table only works for the default font. When we support
// changing font, we will need to plug-in a different table for each font.
match input {
'\u{0000}'..='\u{007F}' => input as u8,
'\u{0020}'..='\u{007E}' => input as u8,
// 0x80 to 0x9F are the C1 control codes with no visual
// representation
'\u{00A0}' => 255, // NBSP
'\u{00A1}' => 173, // ¡
'\u{00A2}' => 189, // ¢
Expand All @@ -315,7 +317,7 @@ impl ConsoleInner {
'\u{00AA}' => 166, // ª
'\u{00AB}' => 174, // «
'\u{00AC}' => 170, // ¬
'\u{00AD}' => 240, // SHY
'\u{00AD}' => 240, // - (Soft Hyphen)
'\u{00AE}' => 169, // ®
'\u{00AF}' => 238, // ¯
'\u{00B0}' => 248, // °
Expand Down Expand Up @@ -401,6 +403,17 @@ impl ConsoleInner {
'\u{0131}' => 213, // ı
'\u{0192}' => 159, // ƒ
'\u{2017}' => 242, // ‗
'\u{2022}' => 7, // •
'\u{203C}' => 19, // ‼
'\u{2190}' => 27, // ←
'\u{2191}' => 24, // ↑
'\u{2192}' => 26, // →
'\u{2193}' => 25, // ↓
'\u{2194}' => 29, // ↔
'\u{2195}' => 18, // ↕
'\u{21A8}' => 23, // ↨
'\u{221F}' => 28, // ∟
'\u{2302}' => 127, // ⌂
'\u{2500}' => 196, // ─
'\u{2502}' => 179, // │
'\u{250C}' => 218, // ┌
Expand Down Expand Up @@ -430,6 +443,25 @@ impl ConsoleInner {
'\u{2592}' => 177, // ▒
'\u{2593}' => 178, // ▓
'\u{25A0}' => 254, // ■
'\u{25AC}' => 22, // ▬
'\u{25B2}' => 30, // ▲
'\u{25BA}' => 16, // ►
'\u{25BC}' => 31, // ▼
'\u{25C4}' => 17, // ◄
'\u{25CB}' => 9, // ○
'\u{25D8}' => 8, // ◘
'\u{25D9}' => 10, // ◙
'\u{263A}' => 1, // ☺
'\u{263B}' => 2, // ☻
'\u{263C}' => 15, // ☼
'\u{2640}' => 12, // ♀
'\u{2642}' => 11, // ♂
'\u{2660}' => 6, // ♠
'\u{2663}' => 5, // ♣
'\u{2665}' => 3, // ♥
'\u{2666}' => 4, // ♦
'\u{266A}' => 13, // ♪
'\u{266B}' => 14, // ♫
_ => b'?',
}
}
Expand Down

0 comments on commit 1445805

Please sign in to comment.