- allocate at least 4-byte area at STR in advance. Returns the
- length of the multi-byte form. If C is an invalid character code,
- signal an error. */
-
-#define CHAR_STRING(c, str) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? *(str) = (unsigned char)(c), 1 \
- : char_to_string (c, (unsigned char *)str))
+ allocate at least MAX_MULTIBYTE_LENGTH bytes area at STR in
+ advance. Returns the length of the multi-byte form. If C is an
+ invalid character code, signal an error. */
+
+#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))
+
+/* Like CHAR_STRING but don't signal an error if C is invalid.
+ Value is -1 in this case. */
+
+#define CHAR_STRING_NO_SIGNAL(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_1 (c, (unsigned char *) str))