[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src coding.c [EMACS_23_1_RC]
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] emacs/src coding.c [EMACS_23_1_RC] |
Date: |
Wed, 08 Jul 2009 02:25:42 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch: EMACS_23_1_RC
Changes by: Kenichi Handa <handa> 09/07/08 02:25:42
Modified files:
src : coding.c
Log message:
(detect_coding_sjis): Handle shift_jis-2004 correctly.
(encode_coding_sjis): Fix the code range check.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/coding.c?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.436&r2=1.436.2.1
Patches:
Index: coding.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/coding.c,v
retrieving revision 1.436
retrieving revision 1.436.2.1
diff -u -b -r1.436 -r1.436.2.1
--- coding.c 19 Jun 2009 08:39:33 -0000 1.436
+++ coding.c 8 Jul 2009 02:25:42 -0000 1.436.2.1
@@ -4671,6 +4671,12 @@
int consumed_chars = 0;
int found = 0;
int c;
+ Lisp_Object attrs, charset_list;
+ int max_first_byte_of_2_byte_code;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ max_first_byte_of_2_byte_code
+ = (XINT (Flength (charset_list)) > 3 ? 0xFC : 0xEF);
detect_info->checked |= CATEGORY_MASK_SJIS;
/* A coding system of this category is always ASCII compatible. */
@@ -4682,7 +4688,8 @@
ONE_MORE_BYTE (c);
if (c < 0x80)
continue;
- if ((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xEF))
+ if ((c >= 0x81 && c <= 0x9F)
+ || (c >= 0xE0 && c <= max_first_byte_of_2_byte_code))
{
ONE_MORE_BYTE (c);
if (c < 0x40 || c == 0x7F || c > 0xFC)
@@ -5055,7 +5062,8 @@
int c1, c2;
c1 = code >> 8;
- if (c1 == 0x21 || (c1 >= 0x23 && c1 < 0x25)
+ if (c1 == 0x21 || (c1 >= 0x23 && c1 <= 0x25)
+ || c1 == 0x28
|| (c1 >= 0x2C && c1 <= 0x2F) || c1 >= 0x6E)
{
JIS_TO_SJIS2 (code);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/src coding.c [EMACS_23_1_RC],
Kenichi Handa <=