X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/charset/blobdiff_plain/c6d25d8d73da77087aa3e413af2ae72f6300891f..32361bda545f94503610f2cdfc85374a07c56635:/charset.h diff --git a/charset.h b/charset.h index 0dca159..545784f 100644 --- a/charset.h +++ b/charset.h @@ -33,6 +33,7 @@ typedef enum { CS_ISO8859_16, CS_CP437, CS_CP850, + CS_CP866, CS_CP1250, CS_CP1251, CS_CP1252, @@ -45,6 +46,7 @@ typedef enum { CS_KOI8_R, CS_KOI8_U, CS_KOI8_RU, + CS_JISX0201, CS_MAC_ROMAN, CS_MAC_TURKISH, CS_MAC_CROATIAN, @@ -83,6 +85,13 @@ typedef enum { CS_SHIFT_JIS, CS_HZ, CS_CP949, + CS_PDF, + CS_PSSTD, + CS_CTEXT, + CS_ISO2022, + CS_BS4730, + CS_DEC_GRAPHICS, + CS_EUC_TW } charset_t; typedef struct { @@ -189,6 +198,13 @@ int charset_from_macenc(int script, int region, int sysvers, const char *fontname); /* + * Convert GNU Emacs coding system symbol to and from our charset + * identifiers. + */ +const char *charset_to_emacsenc(int charset); +int charset_from_emacsenc(const char *name); + +/* * Upgrade a charset identifier to a superset charset which is * often confused with it. For example, people whose MUAs report * their mail as ASCII or ISO8859-1 often in practice turn out to @@ -206,4 +222,15 @@ int charset_upgrade(int charset); */ int charset_contains_ascii(int charset); +/* + * This function tries to deduce the CS_* identifier of the charset + * used in the current C locale. It falls back to CS_ASCII if it + * can't figure it out at all, so it will always return a valid + * charset. + * + * (Note that you should have already called setlocale(LC_CTYPE, + * "") to guarantee that this function will do the right thing.) + */ +int charset_from_locale(void); + #endif /* charset_charset_h */