GNU bug report logs -
#2497
23.0.91; Fails to read UTF-8 on Win2k
Previous Next
Reported by: uwe.siart <at> tum.de
Date: Fri, 27 Feb 2009 14:20:02 UTC
Severity: normal
Merged with 2354
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #147 received at 2497 <at> emacsbugs.donarmstrong.com (full text, mbox):
> From: David Engster <deng <at> randomsample.de>
> Date: Sat, 28 Feb 2009 11:14:16 +0100
> Cc: 2497 <at> emacsbugs.donarmstrong.com
>
> I once again confirmed that this behaviour can be tracked down to this
> change in detect_coding_charset in coding.c (revision 1.413):
>
> --- coding.c 7 Feb 2009 10:49:39 -0000 1.412
> +++ coding.c 9 Feb 2009 00:42:37 -0000 1.413
> @@ -5101,7 +5101,7 @@
> valids = AREF (attrs, coding_attr_charset_valids);
> name = CODING_ID_NAME (coding->id);
> if (VECTORP (Vlatin_extra_code_table)
> - && strcmp ((char *) SDATA (SYMBOL_NAME (name)), "iso-8859-"))
> + && strcmp ((char *) SDATA (SYMBOL_NAME (name)), "iso-8859-") == 0)
> check_latin_extra = 1;
> if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
> src += head_ascii;
>
> I'm inclined to say that this change is wrong, since strcmp will only
> return 0 if two strings are exactly equal. In this case though, the
> string "iso-8859-" is compared to "iso-8859-1" (in my case), so it
> returns 1 and therefore check_latin_extra is not set.
You are right. But in my case, it was not enough to test for
"iso-8859-", as the symbol's name was "iso-latin-1", not "iso-8859-1".
I installed the patch below, that does seem to fix the problem with
the OP's .gnus.el, although I don't know how general that problem is,
nor whether Emacs is capable of distinguishing UTF-8 from Latin-N in
general.
2009-02-28 Eli Zaretskii <eliz <at> gnu.org>
* coding.c (detect_coding_charset): Fix change from 2008-10-21.
Also, check iso-latin-*, not only iso-8859-*.
Index: src/coding.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/coding.c,v
retrieving revision 1.419
diff -u -r1.419 coding.c
--- src/coding.c 22 Feb 2009 15:48:03 -0000 1.419
+++ src/coding.c 28 Feb 2009 12:01:18 -0000
@@ -5103,7 +5103,10 @@
valids = AREF (attrs, coding_attr_charset_valids);
name = CODING_ID_NAME (coding->id);
if (VECTORP (Vlatin_extra_code_table)
- && strcmp ((char *) SDATA (SYMBOL_NAME (name)), "iso-8859-") == 0)
+ && (strncmp ((char *) SDATA (SYMBOL_NAME (name)),
+ "iso-8859-", sizeof ("iso-8859-") - 1) == 0
+ || strncmp ((char *) SDATA (SYMBOL_NAME (name)),
+ "iso-latin-", sizeof ("iso-latin-") - 1) == 0))
check_latin_extra = 1;
if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
src += head_ascii;
This bug report was last modified 16 years and 87 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.