comparison src/print.c @ 20670:b818d996d923

(print) <Lisp_String>: When multibyte is enabled, print single-byte non-ASCII chars using octal escapes.
author Karl Heuer <kwzh@gnu.org>
date Sun, 18 Jan 1998 04:51:16 +0000
parents 0b00b6a96288
children d43ba5d91281
comparison
equal deleted inserted replaced
20669:fa76057543dd 20670:b818d996d923
1147 else if (c == '\f' && print_escape_newlines) 1147 else if (c == '\f' && print_escape_newlines)
1148 { 1148 {
1149 PRINTCHAR ('\\'); 1149 PRINTCHAR ('\\');
1150 PRINTCHAR ('f'); 1150 PRINTCHAR ('f');
1151 } 1151 }
1152 else if (! SINGLE_BYTE_CHAR_P (c) 1152 else if ((! SINGLE_BYTE_CHAR_P (c)
1153 && NILP (current_buffer->enable_multibyte_characters)) 1153 && NILP (current_buffer->enable_multibyte_characters)))
1154 { 1154 {
1155 /* When multibyte is disabled, 1155 /* When multibyte is disabled,
1156 print multibyte string chars using hex escapes. */ 1156 print multibyte string chars using hex escapes. */
1157 unsigned char outbuf[50]; 1157 unsigned char outbuf[50];
1158 sprintf (outbuf, "\\x%x", c); 1158 sprintf (outbuf, "\\x%x", c);
1159 strout (outbuf, -1, -1, printcharfun, 0);
1160 }
1161 else if (SINGLE_BYTE_CHAR_P (c)
1162 && ! ASCII_BYTE_P (c)
1163 && ! NILP (current_buffer->enable_multibyte_characters))
1164 {
1165 /* When multibyte is enabled,
1166 print single-byte non-ASCII string chars
1167 using octal escapes. */
1168 unsigned char outbuf[5];
1169 sprintf (outbuf, "\\%03o", c);
1159 strout (outbuf, -1, -1, printcharfun, 0); 1170 strout (outbuf, -1, -1, printcharfun, 0);
1160 } 1171 }
1161 else 1172 else
1162 { 1173 {
1163 if (c == '\"' || c == '\\') 1174 if (c == '\"' || c == '\\')