emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6a2968b: Avoind string-as-multibyte in ps-output-st


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 6a2968b: Avoind string-as-multibyte in ps-output-string-prim
Date: Fri, 17 May 2019 00:00:33 -0400 (EDT)

branch: master
commit 6a2968b9e7b5ee604751d430879844b5298135e4
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Avoind string-as-multibyte in ps-output-string-prim
    
    * lisp/ps-print.el (ps-output-string-prim): Avoid
    `string-as-multibyte', and encode as utf-8 instead if multibyte.
---
 lisp/ps-print.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 647597c..881d6a8 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -4612,7 +4612,9 @@ page-height == ((floor print-height ((th + ls) * zh)) * 
((th + ls) * zh)) - th
 (defsubst ps-output-string-prim (string)
   (insert "(")                         ;insert start-string delimiter
   (save-excursion                      ;insert string
-    (insert (string-as-unibyte string)))
+    (insert (if (multibyte-string-p string)
+                (encode-coding-string string 'utf-8)
+              string)))
   ;; Find and quote special characters as necessary for PS
   ;; This skips everything except control chars, non-ASCII chars, (, ) and \.
   (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]