charsets: remove HEX charset type

This is no real charset, it is the fake one we used to represent a
UCS2 hex-encoded string.
This commit is contained in:
Aleksander Morgado
2020-11-22 15:02:07 +01:00
parent a025e83e5a
commit 38a4a9c842
2 changed files with 1 additions and 12 deletions

View File

@@ -42,7 +42,6 @@ static const CharsetEntry charset_map[] = {
{ "8859-1", NULL, "ISO8859-1", "ISO8859-1//TRANSLIT", MM_MODEM_CHARSET_8859_1 }, { "8859-1", NULL, "ISO8859-1", "ISO8859-1//TRANSLIT", MM_MODEM_CHARSET_8859_1 },
{ "PCCP437", "CP437", "CP437", "CP437//TRANSLIT", MM_MODEM_CHARSET_PCCP437 }, { "PCCP437", "CP437", "CP437", "CP437//TRANSLIT", MM_MODEM_CHARSET_PCCP437 },
{ "PCDN", "CP850", "CP850", "CP850//TRANSLIT", MM_MODEM_CHARSET_PCDN }, { "PCDN", "CP850", "CP850", "CP850//TRANSLIT", MM_MODEM_CHARSET_PCDN },
{ "HEX", NULL, NULL, NULL, MM_MODEM_CHARSET_HEX },
{ "UTF-16", "UTF16", "UTF-16BE", "UTF-16BE//TRANSLIT", MM_MODEM_CHARSET_UTF16 }, { "UTF-16", "UTF16", "UTF-16BE", "UTF-16BE//TRANSLIT", MM_MODEM_CHARSET_UTF16 },
}; };
@@ -773,11 +772,6 @@ mm_charset_take_and_convert_to_utf8 (gchar *str,
utf8 = str; utf8 = str;
break; break;
case MM_MODEM_CHARSET_HEX:
/* We'll assume that the HEX string is really valid ASCII at the end */
utf8 = str;
break;
case MM_MODEM_CHARSET_GSM: case MM_MODEM_CHARSET_GSM:
utf8 = (gchar *) mm_charset_gsm_unpacked_to_utf8 ((const guint8 *) str, strlen (str)); utf8 = (gchar *) mm_charset_gsm_unpacked_to_utf8 ((const guint8 *) str, strlen (str));
g_free (str); g_free (str);
@@ -903,10 +897,6 @@ mm_utf8_take_and_convert_to_charset (gchar *str,
encoded = str; encoded = str;
break; break;
case MM_MODEM_CHARSET_HEX:
encoded = str;
break;
case MM_MODEM_CHARSET_GSM: case MM_MODEM_CHARSET_GSM:
encoded = (gchar *) mm_charset_utf8_to_unpacked_gsm (str, NULL); encoded = (gchar *) mm_charset_utf8_to_unpacked_gsm (str, NULL);
g_free (str); g_free (str);

View File

@@ -27,8 +27,7 @@ typedef enum {
MM_MODEM_CHARSET_UCS2 = 1 << 4, MM_MODEM_CHARSET_UCS2 = 1 << 4,
MM_MODEM_CHARSET_PCCP437 = 1 << 5, MM_MODEM_CHARSET_PCCP437 = 1 << 5,
MM_MODEM_CHARSET_PCDN = 1 << 6, MM_MODEM_CHARSET_PCDN = 1 << 6,
MM_MODEM_CHARSET_HEX = 1 << 7, MM_MODEM_CHARSET_UTF16 = 1 << 7,
MM_MODEM_CHARSET_UTF16 = 1 << 8,
} MMModemCharset; } MMModemCharset;
const gchar *mm_modem_charset_to_string (MMModemCharset charset); const gchar *mm_modem_charset_to_string (MMModemCharset charset);