Skip to content

Commit c5084c2

Browse files
committed
Add a comment explaining why 94-character sets have a size of 95.
1 parent cf7de8e commit c5084c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/terminal/adapter/charsets.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ namespace Microsoft::Console::VirtualTerminal
4343
return rhs == lhs;
4444
}
4545

46+
// Note that the 94-character sets are deliberately defined with a size of
47+
// 95 to avoid having to test the lower bound. We just alway leave the first
48+
// entry - which is not meant to be mapped - as a SPACE or NBSP, which is at
49+
// least visually equivalent to leaving it untranslated.
50+
4651
typedef CharSet<L'\x20', 95> AsciiBasedCharSet;
4752
typedef CharSet<L'\xa0', 95> Latin1BasedCharSet94;
4853
typedef CharSet<L'\xa0', 96> Latin1BasedCharSet96;

0 commit comments

Comments
 (0)