# HG changeset patch # User Kenichi Handa # Date 912067932 0 # Node ID 1dfb6d38354f4fdf32e12515c651e2bd5d84f53a # Parent 5ee484eaf2bb5655faba071e451a7a6c921f0c09 (non_ascii_char_to_string): If C has modifier bits, make an appropriate one byte string. (char_bytes): Handle the case that C is a single byte char or has modifier bits. diff -r 5ee484eaf2bb -r 1dfb6d38354f src/charset.c --- a/src/charset.c Thu Nov 26 08:12:12 1998 +0000 +++ b/src/charset.c Thu Nov 26 08:12:12 1998 +0000 @@ -141,6 +141,20 @@ { int charset, c1, c2; + if (c & ~GLYPH_MASK_CHAR) + { + if (c & CHAR_META) + /* Move the meta bit to the right place for a string. */ + c |= 0x80; + if (c & CHAR_CTL) + c &= 0x9F; + else if (c & CHAR_SHIFT && (c & 0x7F) >= 'a' && (c & 0x7F) <= 'z') + c -= 'a' - 'A'; + *str = workbuf; + *workbuf = c; + return 1; + } + if (c < 0) invalid_character (c); @@ -1078,6 +1092,9 @@ { int bytes; + if (SINGLE_BYTE_CHAR_P (c) || (c & ~GLYPH_MASK_CHAR)) + return 1; + if (COMPOSITE_CHAR_P (c)) { unsigned int id = COMPOSITE_CHAR_ID (c);