ox-odt: Fix exporting from buffers with non-standard encoding

* lisp/ox-odt.el (org-odt--export-wrap): Enforce 'utf-8 coding system
when writing to odt file, as declared in the template.

Reported-by: Amy Grinn <grinn.amy@gmail.com>
Link: https://orgmode.org/list/87ed3fvu7p.fsf@pop-os.mail-host-address-is-not-set
This commit is contained in:
Ihor Radchenko 2024-11-23 20:09:00 +01:00
parent 984c0c58bb
commit 34a354f0fd
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 1 deletions

View File

@ -4032,7 +4032,11 @@ contextual information."
(kill-buffer buf)))))
;; Delete temporary directory and also other embedded
;; files that get copied there.
(delete-directory org-odt-zip-dir t))))
(delete-directory org-odt-zip-dir t)))
;; We specify UTF-8 in `org-odt-template'. Enforce it even
;; when the buffer text has different encoding.
(coding-system-for-write 'utf-8)
(save-buffer-coding-system 'utf-8))
(condition-case-unless-debug err
(progn
(unless (executable-find "zip")