Previously, latin-1 was incorrectly assumed (bug#70988).
* src/print.c (print_object): Call the correct function.
* test/src/print-tests.el (print-unibyte-symbols): New test.
(cherry picked from commit
f2f76756211fd5a0914734c738508f522c4b2ccd)
{
/* Here, we must convert each multi-byte form to the
corresponding character code before handing it to PRINTCHAR. */
- int c = fetch_string_char_advance (name, &i, &i_byte);
+ int c = fetch_string_char_as_multibyte_advance (name, &i, &i_byte);
maybe_quit ();
if (escapeflag)
(ignore (make-string 100 ?b))))
(should (equal outstr "xxx"))))
+(ert-deftest print-unibyte-symbols ()
+ ;; Non-ASCII in unibyte symbols should print as raw bytes.
+ (should (equal (prin1-to-string (make-symbol "a\xff"))
+ (string-to-multibyte "a\xff")))
+ (should (equal (prin1-to-string (make-symbol "th\303\251"))
+ (string-to-multibyte "th\303\251"))))
+
(provide 'print-tests)
;;; print-tests.el ends here