# HG changeset patch # User Karl Heuer # Date 885099076 0 # Node ID b818d996d92305038eed22344af01cf3b735db3d # Parent fa76057543ddf7a2023ba88ac55f7d6ecb49052a (print) : When multibyte is enabled, print single-byte non-ASCII chars using octal escapes. diff -r fa76057543dd -r b818d996d923 src/print.c --- a/src/print.c Sun Jan 18 04:49:11 1998 +0000 +++ b/src/print.c Sun Jan 18 04:51:16 1998 +0000 @@ -1149,8 +1149,8 @@ PRINTCHAR ('\\'); PRINTCHAR ('f'); } - else if (! SINGLE_BYTE_CHAR_P (c) - && NILP (current_buffer->enable_multibyte_characters)) + else if ((! SINGLE_BYTE_CHAR_P (c) + && NILP (current_buffer->enable_multibyte_characters))) { /* When multibyte is disabled, print multibyte string chars using hex escapes. */ @@ -1158,6 +1158,17 @@ sprintf (outbuf, "\\x%x", c); strout (outbuf, -1, -1, printcharfun, 0); } + else if (SINGLE_BYTE_CHAR_P (c) + && ! ASCII_BYTE_P (c) + && ! NILP (current_buffer->enable_multibyte_characters)) + { + /* When multibyte is enabled, + print single-byte non-ASCII string chars + using octal escapes. */ + unsigned char outbuf[5]; + sprintf (outbuf, "\\%03o", c); + strout (outbuf, -1, -1, printcharfun, 0); + } else { if (c == '\"' || c == '\\')