# HG changeset patch # User Kenichi Handa # Date 971143252 0 # Node ID 803ca8bc08b2d2168323ecad7232e81da4748615 # Parent 565db62c7ee1f7fd9ae116da1768bcfa81d4c15b (CHAR_STRING): Optimized for single byte characters. diff -r 565db62c7ee1 -r 803ca8bc08b2 src/charset.h --- a/src/charset.h Tue Oct 10 02:00:33 2000 +0000 +++ b/src/charset.h Tue Oct 10 02:00:52 2000 +0000 @@ -524,9 +524,11 @@ 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