]> git.eshelyaron.com Git - emacs.git/commitdiff
(print_object): Output multibyte chars 128...255
authorRichard M. Stallman <rms@gnu.org>
Sun, 3 Mar 2002 20:04:17 +0000 (20:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 3 Mar 2002 20:04:17 +0000 (20:04 +0000)
using \x even if ! print_escape_multibyte.

src/print.c

index f0501bd0fb7a545b31a2aa46508b07fbfaea5306..6f9d4a0120cba1140a93664969b11894cf8eca61 100644 (file)
@@ -1429,11 +1429,15 @@ print_object (obj, printcharfun, escapeflag)
                  PRINTCHAR ('\\');
                  PRINTCHAR ('f');
                }
-             else if (multibyte && ! ASCII_BYTE_P (c)
-                      && print_escape_multibyte)
+             else if (multibyte
+                      && ! ASCII_BYTE_P (c)
+                      && (SINGLE_BYTE_CHAR_P (c) || print_escape_multibyte))
                {
                  /* When multibyte is disabled,
-                    print multibyte string chars using hex escapes.  */
+                    print multibyte string chars using hex escapes.
+                    For a char code that could be in a unibyte string,
+                    when found in a multibyte string, always use a hex escape
+                    so it reads back as multibyte.  */
                  unsigned char outbuf[50];
                  sprintf (outbuf, "\\x%x", c);
                  strout (outbuf, -1, -1, printcharfun, 0);