From 3a11748770ce0ca1070947349ed8051c5ec0e485 Mon Sep 17 00:00:00 2001 From: corvid Date: Mon, 26 Nov 2012 05:44:16 +0000 Subject: 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. --- src/decode.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/decode.c b/src/decode.c index 7ea3dc25..c5752e62 100644 --- a/src/decode.c +++ b/src/decode.c @@ -241,24 +241,6 @@ Decode *a_Decode_content_init(const char *format) return dc; } -/* - * 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) { -- cgit v1.2.3