# HG changeset patch # User Kenichi Handa # Date 1028099133 0 # Node ID 233c080b5756a13e701256a37e2db0e2e247955d # Parent 9c97427fb1f6434dc6ae4ece99c77a8186d04c8f (CHAR_TO_BYTE8): If C is not eight-bit char, call multibyte_char_to_unibyte. diff -r 9c97427fb1f6 -r 233c080b5756 src/character.h --- a/src/character.h Wed Jul 31 07:05:17 2002 +0000 +++ b/src/character.h Wed Jul 31 07:05:33 2002 +0000 @@ -51,15 +51,18 @@ #define MAX_4_BYTE_CHAR 0x1FFFFF #define MAX_5_BYTE_CHAR 0x3FFF7F +/* Nonzero iff C is a character that corresponds to a raw 8-bit + byte. */ +#define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) + /* Return the character code for raw 8-bit byte BYTE. */ #define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00) /* Return the raw 8-bit byte for character C. */ -#define CHAR_TO_BYTE8(c) ((c) - 0x3FFF00) - -/* Nonzero iff C is a character that corresponds to a raw 8-bit - byte. */ -#define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) +#define CHAR_TO_BYTE8(c) \ + (CHAR_BYTE8_P (c) \ + ? (c) - 0x3FFF00 \ + : multibyte_char_to_unibyte (c, Qnil)) /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character that corresponds to a raw 8-bit byte. */