More charset fixes

Properly use the G0/G1 charsets only to map characters being drawn to
the screen. And only decode bytes using either Latin-1 or UTF-8,
defaulting to UTF-8 at startup/reset.
This commit is contained in:
Kovid Goyal
2016-11-30 23:36:10 +05:30
parent 83787fbc40
commit 489504cda5
5 changed files with 44 additions and 32 deletions

View File

@@ -72,8 +72,9 @@ class TestParser(BaseTest):
def test_charsets(self):
s = self.create_screen()
pb = partial(self.parse_bytes_dump, s)
pb('\033)0\x0e/_', ('screen_designate_charset', 1, ord('0')), ('screen_change_charset', 1), '/\xa0')
pb('\033%G_', ('screen_change_charset', 2), '_')
pb('\033)0\x0e/_', ('screen_designate_charset', 1, ord('0')), ('screen_change_charset', 1), '/_')
self.ae(str(s.line(0)), '/\xa0 ')
pb('\033%G_', ('screen_use_latin1', 0), '_')
def test_csi_codes(self):
s = self.create_screen()