From e4d6cf8f9959781c682738a4b9e5ea8ae5747b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= Date: Sat, 21 Apr 2018 00:19:10 +0200 Subject: [PATCH] Manage correctly the encoding of files with #+include: directive * lisp/ox.el (org-export--prepare-file-contents): convert the encoding of temporary buffer to Org buffer's encoding. --- lisp/ox.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index 5a83ae01d..a41d4d8d0 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3481,7 +3481,10 @@ the included document. Optional argument INCLUDER is the file name where the inclusion is to happen." (with-temp-buffer - (insert-file-contents file) + (let ((org-buffer-coding-system buffer-file-coding-system)) + (insert-file-contents file) + (unless (eq org-buffer-coding-system buffer-file-coding-system) + (set-buffer-file-coding-system org-buffer-coding-system))) (when lines (let* ((lines (split-string lines "-")) (lbeg (string-to-number (car lines))) -- 2.14.3