[gnome-terminal] encodings: Recategorise



commit 2ffdd43ff23782a56714d1b785fb3820fce94a12
Author: Christian Persch <chpe src gnome org>
Date:   Thu Nov 2 00:48:14 2017 +0100

    encodings: Recategorise
    
    Only the CJK ones have some (limited) usefulness still; everything else
    really is obsolete. So sort the CJK ones at the top, and the rest below
    them.

 src/terminal-encoding.c |  143 ++++++++++++++++++++++++-----------------------
 1 files changed, 72 insertions(+), 71 deletions(-)
---
diff --git a/src/terminal-encoding.c b/src/terminal-encoding.c
index 019624b..5937ff4 100644
--- a/src/terminal-encoding.c
+++ b/src/terminal-encoding.c
@@ -50,8 +50,8 @@
 
 typedef enum {
   GROUP_UNICODE,
-  GROUP_ASIAN,
-  GROUP_EUROPEAN,
+  GROUP_CJKV,
+  GROUP_OBSOLETE,
   LAST_GROUP
 } EncodingGroup;
 
@@ -63,78 +63,79 @@ typedef struct {
 
 /* These MUST be sorted by charset so that bsearch can work! */
 static const EncodingEntry const encodings[] = {
-  { "ARMSCII-8",      N_("Armenian"),            GROUP_ASIAN },
-  { "BIG5",           N_("Chinese Traditional"), GROUP_ASIAN },
-  { "BIG5-HKSCS",     N_("Chinese Traditional"), GROUP_ASIAN },
-  { "CP866",          N_("Cyrillic/Russian"),    GROUP_EUROPEAN },
-  { "EUC-JP",         N_("Japanese"),            GROUP_ASIAN },
-  { "EUC-KR",         N_("Korean"),              GROUP_ASIAN },
-  { "EUC-TW",         N_("Chinese Traditional"), GROUP_ASIAN },
-  { "GB18030",        N_("Chinese Simplified"),  GROUP_ASIAN },
-  { "GB2312",         N_("Chinese Simplified"),  GROUP_ASIAN },
-  { "GBK",            N_("Chinese Simplified"),  GROUP_ASIAN },
-  { "GEORGIAN-PS",    N_("Georgian"),            GROUP_ASIAN },
-  { "IBM850",         N_("Western"),             GROUP_EUROPEAN },
-  { "IBM852",         N_("Central European"),    GROUP_EUROPEAN },
-  { "IBM855",         N_("Cyrillic"),            GROUP_EUROPEAN },
-  { "IBM857",         N_("Turkish"),             GROUP_ASIAN },
-  { "IBM862",         N_("Hebrew"),              GROUP_ASIAN },
-  { "IBM864",         N_("Arabic"),              GROUP_ASIAN },
-  { "ISO-2022-JP",    N_("Japanese"),            GROUP_ASIAN },
-  { "ISO-2022-KR",    N_("Korean"),              GROUP_ASIAN },
-  { "ISO-8859-1",     N_("Western"),             GROUP_EUROPEAN },
-  { "ISO-8859-10",    N_("Nordic"),              GROUP_EUROPEAN },
-  { "ISO-8859-13",    N_("Baltic"),              GROUP_EUROPEAN },
-  { "ISO-8859-14",    N_("Celtic"),              GROUP_EUROPEAN },
-  { "ISO-8859-15",    N_("Western"),             GROUP_EUROPEAN },
-  { "ISO-8859-16",    N_("Romanian"),            GROUP_EUROPEAN },
-  { "ISO-8859-2",     N_("Central European"),    GROUP_EUROPEAN },
-  { "ISO-8859-3",     N_("South European"),      GROUP_EUROPEAN },
-  { "ISO-8859-4",     N_("Baltic"),              GROUP_EUROPEAN },
-  { "ISO-8859-5",     N_("Cyrillic"),            GROUP_EUROPEAN },
-  { "ISO-8859-6",     N_("Arabic"),              GROUP_ASIAN },
-  { "ISO-8859-7",     N_("Greek"),               GROUP_EUROPEAN },
-  { "ISO-8859-8",     N_("Hebrew Visual"),       GROUP_ASIAN },
-  { "ISO-8859-8-I",   N_("Hebrew"),              GROUP_ASIAN },
-  { "ISO-8859-9",     N_("Turkish"),             GROUP_ASIAN },
-  { "ISO-IR-111",     N_("Cyrillic"),            GROUP_EUROPEAN },
-   /* { "JOHAB",      N_("Korean"),              GROUP_ASIAN }, */
-  { "KOI8-R",         N_("Cyrillic"),            GROUP_EUROPEAN },
-  { "KOI8-U",         N_("Cyrillic/Ukrainian"),  GROUP_EUROPEAN },
-  { "MAC-CYRILLIC",   N_("Cyrillic"),            GROUP_EUROPEAN },
-  { "MAC_ARABIC",     N_("Arabic"),              GROUP_ASIAN },
-  { "MAC_CE",         N_("Central European"),    GROUP_EUROPEAN },
-  { "MAC_CROATIAN",   N_("Croatian"),            GROUP_EUROPEAN },
-  { "MAC_DEVANAGARI", N_("Hindi"),               GROUP_ASIAN },
-  { "MAC_FARSI",      N_("Persian"),             GROUP_ASIAN },
-  { "MAC_GREEK",      N_("Greek"),               GROUP_EUROPEAN },
-  { "MAC_GUJARATI",   N_("Gujarati"),            GROUP_ASIAN },
-  { "MAC_GURMUKHI",   N_("Gurmukhi"),            GROUP_ASIAN },
-  { "MAC_HEBREW",     N_("Hebrew"),              GROUP_ASIAN },
-  { "MAC_ICELANDIC",  N_("Icelandic"),           GROUP_EUROPEAN },
-  { "MAC_ROMAN",      N_("Western"),             GROUP_EUROPEAN },
-  { "MAC_ROMANIAN",   N_("Romanian"),            GROUP_EUROPEAN },
-  { "MAC_TURKISH",    N_("Turkish"),             GROUP_ASIAN },
-  { "MAC_UKRAINIAN",  N_("Cyrillic/Ukrainian"),  GROUP_EUROPEAN },
-  { "SHIFT_JIS",      N_("Japanese"),            GROUP_ASIAN },
-  { "TCVN",           N_("Vietnamese"),          GROUP_ASIAN },
-  { "TIS-620",        N_("Thai"),                GROUP_ASIAN },
+  { "ARMSCII-8",      N_("Armenian"),            GROUP_OBSOLETE },
+  { "BIG5",           N_("Chinese Traditional"), GROUP_CJKV },
+  { "BIG5-HKSCS",     N_("Chinese Traditional"), GROUP_CJKV },
+  { "CP866",          N_("Cyrillic/Russian"),    GROUP_OBSOLETE },
+  { "EUC-JP",         N_("Japanese"),            GROUP_CJKV },
+  { "EUC-KR",         N_("Korean"),              GROUP_CJKV },
+  { "EUC-TW",         N_("Chinese Traditional"), GROUP_CJKV },
+  { "GB18030",        N_("Chinese Simplified"),  GROUP_CJKV },
+  { "GB2312",         N_("Chinese Simplified"),  GROUP_CJKV },
+  { "GBK",            N_("Chinese Simplified"),  GROUP_CJKV },
+  { "GEORGIAN-PS",    N_("Georgian"),            GROUP_OBSOLETE },
+  { "IBM850",         N_("Western"),             GROUP_OBSOLETE },
+  { "IBM852",         N_("Central European"),    GROUP_OBSOLETE },
+  { "IBM855",         N_("Cyrillic"),            GROUP_OBSOLETE },
+  { "IBM857",         N_("Turkish"),             GROUP_OBSOLETE },
+  { "IBM862",         N_("Hebrew"),              GROUP_OBSOLETE },
+  { "IBM864",         N_("Arabic"),              GROUP_OBSOLETE },
+  { "ISO-2022-JP",    N_("Japanese"),            GROUP_CJKV },
+  { "ISO-2022-KR",    N_("Korean"),              GROUP_CJKV },
+  { "ISO-8859-1",     N_("Western"),             GROUP_OBSOLETE },
+  { "ISO-8859-10",    N_("Nordic"),              GROUP_OBSOLETE },
+  { "ISO-8859-13",    N_("Baltic"),              GROUP_OBSOLETE },
+  { "ISO-8859-14",    N_("Celtic"),              GROUP_OBSOLETE },
+  { "ISO-8859-15",    N_("Western"),             GROUP_OBSOLETE },
+  { "ISO-8859-16",    N_("Romanian"),            GROUP_OBSOLETE },
+  { "ISO-8859-2",     N_("Central European"),    GROUP_OBSOLETE },
+  { "ISO-8859-3",     N_("South European"),      GROUP_OBSOLETE },
+  { "ISO-8859-4",     N_("Baltic"),              GROUP_OBSOLETE },
+  { "ISO-8859-5",     N_("Cyrillic"),            GROUP_OBSOLETE },
+  { "ISO-8859-6",     N_("Arabic"),              GROUP_OBSOLETE },
+  { "ISO-8859-7",     N_("Greek"),               GROUP_OBSOLETE },
+  { "ISO-8859-8",     N_("Hebrew Visual"),       GROUP_OBSOLETE },
+  { "ISO-8859-8-I",   N_("Hebrew"),              GROUP_OBSOLETE },
+  { "ISO-8859-9",     N_("Turkish"),             GROUP_OBSOLETE },
+  { "ISO-IR-111",     N_("Cyrillic"),            GROUP_OBSOLETE },
+   /* { "JOHAB",      N_("Korean"),              GROUP_CJKV }, */
+  { "KOI8-R",         N_("Cyrillic"),            GROUP_OBSOLETE },
+  { "KOI8-U",         N_("Cyrillic/Ukrainian"),  GROUP_OBSOLETE },
+  { "MAC-CYRILLIC",   N_("Cyrillic"),            GROUP_OBSOLETE },
+  { "MAC_ARABIC",     N_("Arabic"),              GROUP_OBSOLETE },
+  { "MAC_CE",         N_("Central European"),    GROUP_OBSOLETE },
+  { "MAC_CROATIAN",   N_("Croatian"),            GROUP_OBSOLETE },
+  { "MAC_DEVANAGARI", N_("Hindi"),               GROUP_OBSOLETE },
+  { "MAC_FARSI",      N_("Persian"),             GROUP_OBSOLETE },
+  { "MAC_GREEK",      N_("Greek"),               GROUP_OBSOLETE },
+  { "MAC_GUJARATI",   N_("Gujarati"),            GROUP_OBSOLETE },
+  { "MAC_GURMUKHI",   N_("Gurmukhi"),            GROUP_OBSOLETE },
+  { "MAC_HEBREW",     N_("Hebrew"),              GROUP_OBSOLETE },
+  { "MAC_ICELANDIC",  N_("Icelandic"),           GROUP_OBSOLETE },
+  { "MAC_ROMAN",      N_("Western"),             GROUP_OBSOLETE },
+  { "MAC_ROMANIAN",   N_("Romanian"),            GROUP_OBSOLETE },
+  { "MAC_TURKISH",    N_("Turkish"),             GROUP_OBSOLETE },
+  { "MAC_UKRAINIAN",  N_("Cyrillic/Ukrainian"),  GROUP_OBSOLETE },
+  { "SHIFT_JIS",      N_("Japanese"),            GROUP_CJKV },
+  /* This is TCVN-5712-1, not TCVN-5773:1993 which would be CJKV */
+  { "TCVN",           N_("Vietnamese"),          GROUP_OBSOLETE },
+  { "TIS-620",        N_("Thai"),                GROUP_OBSOLETE },
   /* { "UCS-4",       N_("Unicode"),             GROUP_UNICODE }, */
-  { "UHC",            N_("Korean"),              GROUP_ASIAN },
+  { "UHC",            N_("Korean"),              GROUP_CJKV },
   /* { "UTF-16",      N_("Unicode"),             GROUP_UNICODE }, */
   /* { "UTF-32",      N_("Unicode"),             GROUP_UNICODE }, */
   /* { "UTF-7",       N_("Unicode"),             GROUP_UNICODE }, */
   { "UTF-8",          N_("Unicode"),             GROUP_UNICODE },
-  { "VISCII",         N_("Vietnamese"),          GROUP_ASIAN },
-  { "WINDOWS-1250",   N_("Central European"),    GROUP_EUROPEAN },
-  { "WINDOWS-1251",   N_("Cyrillic"),            GROUP_EUROPEAN },
-  { "WINDOWS-1252",   N_("Western"),             GROUP_EUROPEAN },
-  { "WINDOWS-1253",   N_("Greek"),               GROUP_EUROPEAN },
-  { "WINDOWS-1254",   N_("Turkish"),             GROUP_ASIAN },
-  { "WINDOWS-1255",   N_("Hebrew"),              GROUP_ASIAN },
-  { "WINDOWS-1256",   N_("Arabic"),              GROUP_ASIAN },
-  { "WINDOWS-1257",   N_("Baltic"),              GROUP_EUROPEAN },
-  { "WINDOWS-1258",   N_("Vietnamese"),          GROUP_ASIAN },
+  { "VISCII",         N_("Vietnamese"),          GROUP_OBSOLETE },
+  { "WINDOWS-1250",   N_("Central European"),    GROUP_OBSOLETE },
+  { "WINDOWS-1251",   N_("Cyrillic"),            GROUP_OBSOLETE },
+  { "WINDOWS-1252",   N_("Western"),             GROUP_OBSOLETE },
+  { "WINDOWS-1253",   N_("Greek"),               GROUP_OBSOLETE },
+  { "WINDOWS-1254",   N_("Turkish"),             GROUP_OBSOLETE },
+  { "WINDOWS-1255",   N_("Hebrew"),              GROUP_OBSOLETE},
+  { "WINDOWS-1256",   N_("Arabic"),              GROUP_OBSOLETE },
+  { "WINDOWS-1257",   N_("Baltic"),              GROUP_OBSOLETE },
+  { "WINDOWS-1258",   N_("Vietnamese"),          GROUP_OBSOLETE },
 };
 
 static const struct {
@@ -142,8 +143,8 @@ static const struct {
   const char *name;
 } group_names[] = {
   { GROUP_UNICODE,  N_("Unicode") },
-  { GROUP_ASIAN,    N_("Legacy Asian Encodings") },
-  { GROUP_EUROPEAN, N_("Legacy European Encodings") },
+  { GROUP_CJKV,     N_("Legacy CJK Encodings") },
+  { GROUP_OBSOLETE, N_("Obsolete Encodings") },
 };
 
 #define EM_DASH "—"


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