summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-11-26 08:12:12 +0000
committerKenichi Handa <handa@m17n.org>1998-11-26 08:12:12 +0000
commit8ac5a9ccbea508022c58c0c0adb36f56b89494a0 (patch)
tree13b755f1b9c71db884ddac0247078f30f8909afb
parent43229ac34bea8bd5de57183d17cee1ade4065297 (diff)
downloademacs-8ac5a9ccbea508022c58c0c0adb36f56b89494a0.tar.gz
(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.
-rw-r--r--src/charset.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/charset.c b/src/charset.c
index 054b2848894..bf3944d47fa 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -141,6 +141,20 @@ non_ascii_char_to_string (c, workbuf, str)
{
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 @@ char_bytes (c)
{
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);