[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5f22c090b1a: Make djvused emit UTF-8 encoded text
From: |
Tassilo Horn |
Subject: |
master 5f22c090b1a: Make djvused emit UTF-8 encoded text |
Date: |
Fri, 18 Oct 2024 02:07:11 -0400 (EDT) |
branch: master
commit 5f22c090b1ae87b516b132b36a5908a5e18c2d11
Author: Visuwesh <visuweshm@gmail.com>
Commit: Tassilo Horn <tsdh@gnu.org>
Make djvused emit UTF-8 encoded text
* lisp/doc-view.el (doc-view--djvu-outline): Pass -u to djvused
to make it emit UTF-8 encoded text rather than using octal
escapes for non-ASCII string. (bug#73846)
---
lisp/doc-view.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index bbfbbdec925..4d7d36c8a16 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -2026,13 +2026,16 @@ name.
For the format, see `doc-view--pdf-outline'."
(unless file-name (setq file-name (buffer-file-name)))
(with-temp-buffer
- (call-process doc-view-djvused-program nil (current-buffer) nil
- "-e" "print-outline" file-name)
- (goto-char (point-min))
- (when (eobp)
- (setq doc-view--outline 'unavailable)
- (imenu-unavailable-error "Unable to create imenu index using `djvused'"))
- (nreverse (doc-view--parse-djvu-outline (read (current-buffer))))))
+ (let ((coding-system-for-read 'utf-8))
+ ;; Pass "-u" to make `djvused' emit UTF-8 encoded text to avoid
+ ;; unescaping octal escapes for non-ASCII text.
+ (call-process doc-view-djvused-program nil (current-buffer) nil
+ "-u" "-e" "print-outline" file-name)
+ (goto-char (point-min))
+ (when (eobp)
+ (setq doc-view--outline 'unavailable)
+ (imenu-unavailable-error "Unable to create imenu index using
`djvused'"))
+ (nreverse (doc-view--parse-djvu-outline (read (current-buffer)))))))
(defun doc-view--parse-djvu-outline (bookmark &optional level)
"Return a list describing the djvu outline from BOOKMARK.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 5f22c090b1a: Make djvused emit UTF-8 encoded text,
Tassilo Horn <=