aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2012-11-26 05:44:16 +0000
committercorvid <corvid@lavabit.com>2012-11-26 05:44:16 +0000
commit3a11748770ce0ca1070947349ed8051c5ec0e485 (patch)
treeda504660b8fab1670f6723ad4bcec402cbc49cfd
parent3202ed972b013c09e6020fe2d6c4f8e64173fb8a (diff)
rm Decode_is_ascii()
An "official" -- ostensible -- reason is that we shouldn't treat a supposedly ascii page like utf-8 even if it is a subset. A deeper reason is that I've long felt a little bit bad about spending time on string comparisions that hardly ever match.
-rw-r--r--src/decode.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/decode.c b/src/decode.c
index 7ea3dc25..c5752e62 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -242,24 +242,6 @@ Decode *a_Decode_content_init(const char *format)
}
/*
- * Legal names for the ASCII character set
- */
-static int Decode_is_ascii(const char *str)
-{
- return (!(dStrAsciiCasecmp(str, "ASCII") &&
- dStrAsciiCasecmp(str, "US-ASCII") &&
- dStrAsciiCasecmp(str, "us") &&
- dStrAsciiCasecmp(str, "IBM367") &&
- dStrAsciiCasecmp(str, "cp367") &&
- dStrAsciiCasecmp(str, "csASCII") &&
- dStrAsciiCasecmp(str, "ANSI_X3.4-1968") &&
- dStrAsciiCasecmp(str, "iso-ir-6") &&
- dStrAsciiCasecmp(str, "ANSI_X3.4-1986") &&
- dStrAsciiCasecmp(str, "ISO_646.irv:1991") &&
- dStrAsciiCasecmp(str, "ISO646-US")));
-}
-
-/*
* Initialize decoder to translate from any character set known to iconv()
* to UTF-8.
*
@@ -272,8 +254,7 @@ Decode *a_Decode_charset_init(const char *format)
if (format &&
strlen(format) &&
- dStrAsciiCasecmp(format,"UTF-8") &&
- !Decode_is_ascii(format)) {
+ dStrAsciiCasecmp(format,"UTF-8")) {
iconv_t ic = iconv_open("UTF-8", format);
if (ic != (iconv_t) -1) {