summaryrefslogtreecommitdiff
path: root/lisp/ps-print.el
diff options
context:
space:
mode:
authorƁukasz Stelmach <stlman@poczta.fm>2016-02-23 14:54:30 +1100
committerLars Ingebrigtsen <larsi@gnus.org>2016-02-23 14:54:30 +1100
commit3cedbdcc71ebefc12bd20ec84f74251fe99ee7d0 (patch)
tree9d05c0eed05b9937525cbf7132fe7f368e35b7eb /lisp/ps-print.el
parentdea946d1bc9ae14d9d9e5c409c9e0d1492ed4f10 (diff)
downloademacs-3cedbdcc71ebefc12bd20ec84f74251fe99ee7d0.tar.gz
Encode header strings before printing
* lisp/ps-print.el (ps-generate-header-line): Encode the header strings to avoid problems with non-ASCII headers (bug#22611).
Diffstat (limited to 'lisp/ps-print.el')
-rw-r--r--lisp/ps-print.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 7333709c19c..2ea0919c686 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -4761,7 +4761,11 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th
;; Literal strings should be output as is -- the string must contain its own
;; PS string delimiters, '(' and ')', if necessary.
((stringp content)
- (ps-output content))
+ (if (functionp ps-encode-header-string-function)
+ (dolist (elem (funcall ps-encode-header-string-function
+ content fonttag))
+ (ps-output elem))
+ (ps-output content)))
;; Functions are called -- they should return strings; they will be inserted
;; as strings and the PS string delimiters added.
@@ -4777,7 +4781,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th
((and (symbolp content) (boundp content))
(if (fboundp ps-encode-header-string-function)
(dolist (l (funcall ps-encode-header-string-function
- (symbol-value content) fonttag))
+ (symbol-value content) fonttag))
(ps-output-string l))
(ps-output-string (symbol-value content))))