Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
b84ae584
Commit
b84ae584
authored
Nov 25, 2010
by
Kenichi Handa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix decoding of emacs-mule coding system.
parent
cf5314c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
20 deletions
+34
-20
src/ChangeLog
src/ChangeLog
+16
-0
src/charset.c
src/charset.c
+3
-3
src/charset.h
src/charset.h
+1
-3
src/coding.c
src/coding.c
+10
-10
src/lread.c
src/lread.c
+4
-4
No files found.
src/ChangeLog
View file @
b84ae584
2010-11-25 Kenichi Handa <handa@m17n.org>
* charset.c (emacs_mule_charset): Make it an array of charset ID;
i.e. integer.
(Fdefine_charset_internal): Adjusted for the above change.
(init_charset_once): Likewise.
* charset.h (emacs_mule_charset): Adjust the prototype. Delete
duplicated extern.
* coding.c (emacs_mule_char): Adjust for the change of
emacs_mule_charset.
* lread.c (read_emacs_mule_char): Adjust for the change of
emacs_mule_charset.
2010-10-18 Ken Brown <kbrown@cornell.edu>
* s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225).
...
...
src/charset.c
View file @
b84ae584
...
...
@@ -115,7 +115,7 @@ Lisp_Object Viso_2022_charset_list;
/* List of emacs-mule charsets. */
Lisp_Object
Vemacs_mule_charset_list
;
struct
charset
*
emacs_mule_charset
[
256
];
int
emacs_mule_charset
[
256
];
/* Mapping table from ISO2022's charset (specified by DIMENSION,
CHARS, and FINAL-CHAR) to Emacs' charset. */
...
...
@@ -1248,7 +1248,7 @@ usage: (define-charset-internal ...) */)
if
(
charset
.
emacs_mule_id
>=
0
)
{
emacs_mule_charset
[
charset
.
emacs_mule_id
]
=
CHARSET_FROM_ID
(
id
)
;
emacs_mule_charset
[
charset
.
emacs_mule_id
]
=
id
;
if
(
charset
.
emacs_mule_id
<
0xA0
)
emacs_mule_bytes
[
charset
.
emacs_mule_id
]
=
charset
.
dimension
+
1
;
else
...
...
@@ -2405,7 +2405,7 @@ init_charset_once ()
iso_charset_table
[
i
][
j
][
k
]
=
-
1
;
for
(
i
=
0
;
i
<
256
;
i
++
)
emacs_mule_charset
[
i
]
=
NULL
;
emacs_mule_charset
[
i
]
=
-
1
;
charset_jisx0201_roman
=
-
1
;
charset_jisx0208_1978
=
-
1
;
...
...
src/charset.h
View file @
b84ae584
...
...
@@ -255,7 +255,7 @@ extern Lisp_Object Vcharset_list;
extern
Lisp_Object
Viso_2022_charset_list
;
extern
Lisp_Object
Vemacs_mule_charset_list
;
extern
struct
charset
*
emacs_mule_charset
[
256
];
extern
int
emacs_mule_charset
[
256
];
extern
Lisp_Object
Vcurrent_iso639_language
;
...
...
@@ -517,8 +517,6 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
#define EMACS_MULE_LEADING_CODE_PRIVATE_21 0x9C
/* 2/2 */
#define EMACS_MULE_LEADING_CODE_PRIVATE_22 0x9D
/* 2/2 */
extern
struct
charset
*
emacs_mule_charset
[
256
];
extern
Lisp_Object
Qcharsetp
;
...
...
src/coding.c
View file @
b84ae584
...
...
@@ -2078,7 +2078,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base = src;
int multibytep = coding->src_multibyte;
struct charset *charset
;
int charset_id
;
unsigned code;
int c;
int consumed_chars = 0;
...
...
@@ -2088,7 +2088,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
if (c < 0)
{
c = -c;
charset = emacs_mule_charset[0];
charset
_id
= emacs_mule_charset[0];
}
else
{
...
...
@@ -2124,7 +2124,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
switch (emacs_mule_bytes[c])
{
case 2:
if (
! (charset = emacs_mule_charset[c])
)
if (
(charset_id = emacs_mule_charset[c]) < 0
)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
...
...
@@ -2137,7 +2137,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
|| c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
{
ONE_MORE_BYTE (c);
if (c < 0xA0 ||
! (charset = emacs_mule_charset[c])
)
if (c < 0xA0 ||
(charset_id = emacs_mule_charset[c]) < 0
)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
...
...
@@ -2146,7 +2146,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
}
else
{
if (
! (charset = emacs_mule_charset[c])
)
if (
(charset_id = emacs_mule_charset[c]) < 0
)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
...
...
@@ -2161,7 +2161,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
case 4:
ONE_MORE_BYTE (c);
if (c < 0 ||
! (charset = emacs_mule_charset[c])
)
if (c < 0 ||
(charset_id = emacs_mule_charset[c]) < 0
)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
...
...
@@ -2175,21 +2175,21 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
case 1:
code = c;
charset = CHARSET_FROM_ID (ASCII_BYTE_P (code)
? charset_ascii : charset_eight_bit);
charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
break;
default:
abort ();
}
CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c);
CODING_DECODE_CHAR (coding, src, src_base, src_end,
CHARSET_FROM_ID (charset_id), code, c);
if (c < 0)
goto invalid_code;
}
*nbytes = src - src_base;
*nchars = consumed_chars;
if (id)
*id = charset
->
id;
*id = charset
_
id;
return (mseq_found ? -c : c);
no_more_source:
...
...
src/lread.c
View file @
b84ae584
...
...
@@ -616,7 +616,7 @@ read_emacs_mule_char (c, readbyte, readcharfun)
if
(
len
==
2
)
{
charset
=
emacs_mule_charset
[
buf
[
0
]]
;
charset
=
CHARSET_FROM_ID
(
emacs_mule_charset
[
buf
[
0
]])
;
code
=
buf
[
1
]
&
0x7F
;
}
else
if
(
len
==
3
)
...
...
@@ -624,18 +624,18 @@ read_emacs_mule_char (c, readbyte, readcharfun)
if
(
buf
[
0
]
==
EMACS_MULE_LEADING_CODE_PRIVATE_11
||
buf
[
0
]
==
EMACS_MULE_LEADING_CODE_PRIVATE_12
)
{
charset
=
emacs_mule_charset
[
buf
[
1
]]
;
charset
=
CHARSET_FROM_ID
(
emacs_mule_charset
[
buf
[
1
]])
;
code
=
buf
[
2
]
&
0x7F
;
}
else
{
charset
=
emacs_mule_charset
[
buf
[
0
]]
;
charset
=
CHARSET_FROM_ID
(
emacs_mule_charset
[
buf
[
0
]])
;
code
=
((
buf
[
1
]
<<
8
)
|
buf
[
2
])
&
0x7F7F
;
}
}
else
{
charset
=
emacs_mule_charset
[
buf
[
1
]]
;
charset
=
CHARSET_FROM_ID
(
emacs_mule_charset
[
buf
[
1
]])
;
code
=
((
buf
[
2
]
<<
8
)
|
buf
[
3
])
&
0x7F7F
;
}
c
=
DECODE_CHAR
(
charset
,
code
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment