[vte] parser: charset: Add a DEC private OCS



commit 668173e13e22d840fe418a2276f81161f82bcdb2
Author: Christian Persch <chpe src gnome org>
Date:   Fri Oct 19 23:46:03 2018 +0200

    parser: charset: Add a DEC private OCS

 src/parser-charset-tables.hh | 3 +++
 src/parser-charset.hh        | 4 ++++
 src/parser-test.cc           | 2 +-
 src/parser.cc                | 4 ++--
 4 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/parser-charset-tables.hh b/src/parser-charset-tables.hh
index 855c2216..48762464 100644
--- a/src/parser-charset-tables.hh
+++ b/src/parser-charset-tables.hh
@@ -208,6 +208,9 @@ static uint8_t const charset_control_single[] = {
  * ESC 2/5 F
  */
 static uint8_t const charset_ocs_with_return[] = {
+        /* 3/0..3/15 */
+        NA, NA, NA, NA, NA, NA, NA, NA,
+        NA, NA, NA, NA, NA, DEC(IBM_PROPRINTER), NA, NA,
         /* 4/0..4/8 */
         RET, IR(108), IR(178), IR(131), IR(145), IR(160), IR(161), IR(196),
         IR(188)
diff --git a/src/parser-charset.hh b/src/parser-charset.hh
index 1798cce7..2605f327 100644
--- a/src/parser-charset.hh
+++ b/src/parser-charset.hh
@@ -295,6 +295,10 @@ ALIAS(SUPPLEMENTAL_NAME(LATIN_2), IR_NAME(101))
 ALIAS(SUPPLEMENTAL_NAME(LATIN_5), IR_NAME(148))
 ALIAS(SUPPLEMENTAL_NAME(LATIN_CYRILLIC), IR_NAME(144))
 
+/* Other coding systems */
+
+DEC(IBM_PROPRINTER) /* DEC PPLV2; ESC 2/5 3/13 */
+
 #undef IR_NAME
 #undef DEC_NAME
 #undef NRCS_NAME
diff --git a/src/parser-test.cc b/src/parser-test.cc
index 89bdab1b..d5339bb1 100644
--- a/src/parser-test.cc
+++ b/src/parser-test.cc
@@ -578,7 +578,7 @@ test_seq_esc_charset_other(void)
         test_seq_esc_charset(i, 1,
                              charset_ocs_with_return,
                              G_N_ELEMENTS(charset_ocs_with_return),
-                             0x40, VTE_CMD_DOCS, VTE_CHARSET_NONE, 0);
+                             0x30, VTE_CMD_DOCS, VTE_CHARSET_NONE, 0);
 
         i[1] = 0x2f;
         test_seq_esc_charset(i, 2,
diff --git a/src/parser.cc b/src/parser.cc
index ccc20980..340ba15d 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -253,8 +253,8 @@ static unsigned int vte_parse_charset_ocs(uint32_t raw,
         switch (VTE_SEQ_INTERMEDIATE(intermediates)) {
         case VTE_SEQ_INTERMEDIATE_NONE:  /* OCS with standard return */
                 if (remaining_intermediates == 0 &&
-                    raw >= 0x40 && raw < (0x40 + G_N_ELEMENTS(charset_ocs_with_return)))
-                        return charset_ocs_with_return[raw - 0x40];
+                    raw >= 0x30 && raw < (0x30 + G_N_ELEMENTS(charset_ocs_with_return)))
+                        return charset_ocs_with_return[raw - 0x30];
                 break;
 
         case VTE_SEQ_INTERMEDIATE_SLASH: /* OCS without standard return */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]