X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/charset/blobdiff_plain/cdb08fdcd50edb68ab12ee476957657dcf9b8c52..8bade1133caa9fbcecdeed2608dcbb4918180a62:/charset.h diff --git a/charset.h b/charset.h index 3880fbd..ebaafc9 100644 --- a/charset.h +++ b/charset.h @@ -45,6 +45,7 @@ typedef enum { CS_KOI8_R, CS_KOI8_U, CS_KOI8_RU, + CS_JISX0201, CS_MAC_ROMAN, CS_MAC_TURKISH, CS_MAC_CROATIAN, @@ -84,6 +85,7 @@ typedef enum { CS_HZ, CS_CP949, CS_PDF, + CS_CTEXT, } charset_t; typedef struct { @@ -207,4 +209,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 */