summaryrefslogtreecommitdiff
path: root/src/charset.h
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2000-10-10 02:00:52 +0000
committerKenichi Handa <handa@m17n.org>2000-10-10 02:00:52 +0000
commite10ae834bc2faf1ab859f72cb1f867db1f489cad (patch)
tree020a7b1f5d7819ce26f827bc6e274a8e58fccc93 /src/charset.h
parentcaff31d41e1742043403ab69bc68027ecd3120d0 (diff)
downloademacs-e10ae834bc2faf1ab859f72cb1f867db1f489cad.tar.gz
(CHAR_STRING): Optimized for single byte characters.
Diffstat (limited to 'src/charset.h')
-rw-r--r--src/charset.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/charset.h b/src/charset.h
index 83b31abf1f6..b8ee0af40f7 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -524,9 +524,11 @@ extern int iso_charset_table[2][2][128];
advance. Returns the length of the multi-byte form. If C is an
invalid character code, signal an error. */
-#define CHAR_STRING(c, str) \
- (ASCII_BYTE_P (c) \
- ? (*(str) = (unsigned char)(c), 1) \
+#define CHAR_STRING(c, str) \
+ (SINGLE_BYTE_CHAR_P (c) \
+ ? ((ASCII_BYTE_P (c) || c >= 0xA0) \
+ ? (*(str) = (unsigned char)(c), 1) \
+ : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
: char_to_string (c, (unsigned char *) str))
/* Return a character code of the character of which multi-byte form