diff options
author | Andreas Schwab <schwab@suse.de> | 2004-04-26 21:56:26 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2004-04-26 21:56:26 +0000 |
commit | 4b5af5e47974a01c030c92aa34003bd70a2bd947 (patch) | |
tree | 06dd254a44c9d7acafa85f72e890ee9f6e2d9440 /src/print.c | |
parent | db85986c76f0b1c4c34ff86b6305004c3c0f1ec4 (diff) | |
download | emacs-4b5af5e47974a01c030c92aa34003bd70a2bd947.tar.gz |
(print_object): Print non-ascii characters in bool vector representation
as octal escapes. Use BOOL_VECTOR_BITS_PER_CHAR instead of BITS_PER_CHAR.
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c index 89690fe5399..7548bc75661 100644 --- a/src/print.c +++ b/src/print.c @@ -1,5 +1,5 @@ /* Lisp object printing and output streams. - Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 2003 + Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 03, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1783,7 +1783,8 @@ print_object (obj, printcharfun, escapeflag) register unsigned char c; struct gcpro gcpro1; int size_in_chars - = (XBOOL_VECTOR (obj)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; + = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); GCPRO1 (obj); @@ -1814,6 +1815,14 @@ print_object (obj, printcharfun, escapeflag) PRINTCHAR ('\\'); PRINTCHAR ('f'); } + else if (c > '\177') + { + /* Use octal escapes to avoid encoding issues. */ + PRINTCHAR ('\\'); + PRINTCHAR ('0' + ((c >> 6) & 3)); + PRINTCHAR ('0' + ((c >> 3) & 7)); + PRINTCHAR ('0' + (c & 7)); + } else { if (c == '\"' || c == '\\') |