Ensure charsets are always valid

This commit is contained in:
Kovid Goyal
2016-11-19 13:13:36 +05:30
parent ce6a4ca21e
commit b38055b912
2 changed files with 5 additions and 1 deletions

View File

@@ -163,8 +163,9 @@ uint16_t* translation_table(char which) {
return charset_translations[2];
case 'V':
return charset_translations[3];
default:
return charset_translations[0];
}
return charset_translations[0];
}
// UTF-8 decode taken from: http://bjoern.hoehrmann.de/utf-8/decoder/dfa/

View File

@@ -587,6 +587,9 @@ void screen_restore_cursor(Screen *self) {
screen_cursor_position(self, 1, 1);
tracker_cursor_changed(self->change_tracker);
screen_reset_mode(self, DECOM);
self->current_charset = 2;
self->g0_charset = translation_table('B');
self->g1_charset = translation_table('0');
} else {
self->g0_charset = sp->g0_charset;
self->g1_charset = sp->g1_charset;