From 2b4fa986ac43b5a8705f2d24e5fc908e07a89b94 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 5 Apr 2013 17:33:03 -0400 Subject: [PATCH 2/3] Remove byte-order mark check from 'scm_i_scan_for_encoding'. * libguile/read.c (scm_i_scan_for_encoding): Remove byte-order mark check. --- libguile/read.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libguile/read.c b/libguile/read.c index 64b55c3..e2e2e4a 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -1986,7 +1986,6 @@ scm_i_scan_for_encoding (SCM port) char header[SCM_ENCODING_SEARCH_SIZE+1]; size_t bytes_read, encoding_length, i; char *encoding = NULL; - int utf8_bom = 0; char *pos, *encoding_start; int in_comment; @@ -2031,10 +2030,6 @@ scm_i_scan_for_encoding (SCM port) scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET)); } - if (bytes_read > 3 - && header[0] == '\xef' && header[1] == '\xbb' && header[2] == '\xbf') - utf8_bom = 1; - /* search past "coding[:=]" */ pos = header; while (1) @@ -2103,11 +2098,6 @@ scm_i_scan_for_encoding (SCM port) /* This wasn't in a comment */ return NULL; - if (utf8_bom && c_strcasecmp(encoding, "UTF-8")) - scm_misc_error (NULL, - "the port input declares the encoding ~s but is encoded as UTF-8", - scm_list_1 (scm_from_locale_string (encoding))); - return encoding; } -- 1.7.10.4