aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2002-08-15 02:28:08 +0000
committerKenichi Handa2002-08-15 02:28:08 +0000
commitac86488bf2640f4e20dbbbad2252309c63c95d29 (patch)
treeee6a0d0a999d947caba7fe9bfe7259d1e22f0322
parent556383ac2ff74441229709976a85b9ea8be910cc (diff)
downloademacs-ac86488bf2640f4e20dbbbad2252309c63c95d29.tar.gz
emacs-ac86488bf2640f4e20dbbbad2252309c63c95d29.zip
(unibyte_char_to_multibyte): Refer to
charset_unibyte, not charset_primary. (multibyte_char_to_unibyte): Likewise. (Funibyte_char_to_multibyte): Likewise.
-rw-r--r--src/character.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/character.c b/src/character.c
index 6e2b28a495f..376b33ba982 100644
--- a/src/character.c
+++ b/src/character.c
@@ -181,14 +181,14 @@ translate_char (table, c)
181} 181}
182 182
183/* Convert the unibyte character C to the corresponding multibyte 183/* Convert the unibyte character C to the corresponding multibyte
184 character based on the current value of charset_primary. If C 184 character based on the current value of charset_unibyte. If C
185 can't be converted, return C. */ 185 can't be converted, return C. */
186 186
187int 187int
188unibyte_char_to_multibyte (c) 188unibyte_char_to_multibyte (c)
189 int c; 189 int c;
190{ 190{
191 struct charset *charset = CHARSET_FROM_ID (charset_primary); 191 struct charset *charset = CHARSET_FROM_ID (charset_unibyte);
192 int c1 = DECODE_CHAR (charset, c); 192 int c1 = DECODE_CHAR (charset, c);
193 193
194 return ((c1 >= 0) ? c1 : c); 194 return ((c1 >= 0) ? c1 : c);
@@ -196,8 +196,8 @@ unibyte_char_to_multibyte (c)
196 196
197 197
198/* Convert the multibyte character C to unibyte 8-bit character based 198/* Convert the multibyte character C to unibyte 8-bit character based
199 on the current value of charset_primary. If dimension of 199 on the current value of charset_unibyte. If dimension of
200 charset_primary is more than one, return (C & 0xFF). 200 charset_unibyte is more than one, return (C & 0xFF).
201 201
202 The argument REV_TBL is now ignored. It will be removed in the 202 The argument REV_TBL is now ignored. It will be removed in the
203 future. */ 203 future. */
@@ -207,7 +207,7 @@ multibyte_char_to_unibyte (c, rev_tbl)
207 int c; 207 int c;
208 Lisp_Object rev_tbl; 208 Lisp_Object rev_tbl;
209{ 209{
210 struct charset *charset = CHARSET_FROM_ID (charset_primary); 210 struct charset *charset = CHARSET_FROM_ID (charset_unibyte);
211 unsigned c1 = ENCODE_CHAR (charset, c); 211 unsigned c1 = ENCODE_CHAR (charset, c);
212 212
213 return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF); 213 return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);
@@ -244,7 +244,7 @@ the current primary charset (value of `charset-primary'). */)
244 c = XFASTINT (ch); 244 c = XFASTINT (ch);
245 if (c >= 0400) 245 if (c >= 0400)
246 error ("Invalid unibyte character: %d", c); 246 error ("Invalid unibyte character: %d", c);
247 charset = CHARSET_FROM_ID (charset_primary); 247 charset = CHARSET_FROM_ID (charset_unibyte);
248 c = DECODE_CHAR (charset, c); 248 c = DECODE_CHAR (charset, c);
249 if (c < 0) 249 if (c < 0)
250 c = BYTE8_TO_CHAR (XFASTINT (ch)); 250 c = BYTE8_TO_CHAR (XFASTINT (ch));
@@ -260,7 +260,6 @@ the current primary charset (value of `charset-primary'). */)
260 Lisp_Object ch; 260 Lisp_Object ch;
261{ 261{
262 int c; 262 int c;
263 struct charset *charset;
264 263
265 CHECK_CHARACTER (ch); 264 CHECK_CHARACTER (ch);
266 c = XFASTINT (ch); 265 c = XFASTINT (ch);