From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2Hk8A7E7rF8xZgAA0tVLHw (envelope-from ) for ; Wed, 11 Nov 2020 19:29:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KDO/OrA7rF96JAAA1q6Kng (envelope-from ) for ; Wed, 11 Nov 2020 19:29:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 04E4594042B for ; Wed, 11 Nov 2020 19:29:51 +0000 (UTC) Received: from localhost ([::1]:36278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcvoT-0005OO-S6 for larch@yhetil.org; Wed, 11 Nov 2020 14:29:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcq48-0007oD-LT for emacs-orgmode@gnu.org; Wed, 11 Nov 2020 08:21:36 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:33568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcq46-0005Ae-EA for emacs-orgmode@gnu.org; Wed, 11 Nov 2020 08:21:36 -0500 Received: by mail-wr1-x431.google.com with SMTP id b8so2540846wrn.0 for ; Wed, 11 Nov 2020 05:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=MvpgoTl9PEqnSupINQjSLdOY56KuDQ2oEcc4ExLYeFM=; b=czKLsJnEvEEMwHUChSbOB2hkmzeFY19aNaRvrqn7xIUe8e+glHrsO5ddooQbUo6g8H DhuuU0HwdltlJ6dr/FcWzHrbqmWhpWP7p0UUIjJSZS4cgty+2O187Yb8oYHVjsEaH7Xp vEPfjEAL5+ibXAstR1RJYrXkTdVyYlg0JVgCOs4oi9JDHEjRKLHpAk8i7ymuyTPlnBF+ 6q2t+dQn0ZS8iXbqWxviTylZRL7lQQLVvRsF+7nM7GgY/m87fvqZdbUCnPDCrkmZM+qs kalnAmVvYFh2xFpJz9cTgkLu02RjUmY4zY/ocPbyzuN6/IBKNB+yDvsVz5wOdtD5HpeQ YnWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=MvpgoTl9PEqnSupINQjSLdOY56KuDQ2oEcc4ExLYeFM=; b=dvYkVxQ6EfhyBN+0cv/KZ7rA0HBjPspvKp3RPZc1A9vo/W7mktBfcW3vbnrWy5J1/w 023ogo4w2tXBNs7yZHPHOerVm3OSJGyLcGfAKbx2bT96KU5wJlqb1N7iSgLZ9cCbD4/N ZIgRR575ldAx1hJ6c4TEwybnlYOI5B/yEGVpUfYs48uTGrpR1tZ9V90P1HMtzd6VOkn3 cPRwq24VKcXqfWLw8SwtOyst0rv/8xlmlZRYo/czEV9hFQGmDFm7axEYFfE8WeoszaMP rqBeffuhvURcL3m5deV7FqTb8Y9QKPLO6x0z/GDjJ4+hFugcV1by7u/kDjvb0UCviMf/ m55A== X-Gm-Message-State: AOAM532tlyd3dOS+5KfTurNYN6KY7wy6sIKML4tbg+iIQvcxqg9bX83S hXkSB4UdDhnVzpzibEVQ3aGQBHKP614= X-Google-Smtp-Source: ABdhPJxi5ueVjXeNW+w34mdwAzQTEwFVmoyEFio5bKmWxKrVuWOUszZXCQ+0eFfo2lu/DV9rGgUU3A== X-Received: by 2002:a5d:4a0a:: with SMTP id m10mr15292803wrq.16.1605100891934; Wed, 11 Nov 2020 05:21:31 -0800 (PST) Received: from lorien (home.raoult.com. [78.214.78.108]) by smtp.gmail.com with ESMTPSA id k20sm2651824wmi.15.2020.11.11.05.21.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 05:21:30 -0800 (PST) Received: from lorien (localhost [127.0.0.1]) by lorien (Postfix) with ESMTPS id 0D15642AE0 for ; Wed, 11 Nov 2020 14:14:35 +0100 (CET) From: Bruno Raoult To: emacs-orgmode@gnu.org Subject: Bug: ODT export incorrect when org file contains a Byte Order Mark [9.4 (9.4-29-g20374f-elpaplus @ /home/br/.emacs.d/elpa/org-plus-contrib-20201102/)] Date: Wed, 11 Nov 2020 14:14:34 +0100 Message-ID: <87ft5g2fyd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=braoult@gmail.com; helo=mail-wr1-x431.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 11 Nov 2020 14:21:41 -0500 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=czKLsJnE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: LqryJ95VCrsQ --=-=-= Content-Type: text/plain When an org buffer coding system is "utf-8-with-signature-unix" (the first 3 bytes in file are 0xEF 0xBB 0xBF), export to ODT gives following LibreOffice error when opening the exported file : "The file 'test.odt' is corrupt and therefore cannot be opened. LibreOffice can try to repair the file. [etc...]". If we set the encoding to "utf-8-unix" (no BOM), export is correct, and LibreOffice does not complain. To reproduce: Create a minimal org buffer, change the coding system (set-buffer-file-coding-system) to "utf-8-with-signature-unix", then export to ODT (C-c C-e o o), and open the generated odt file with LibreOffice. Note: Export to different formats (html, PDF, LaTeX) look correct. Versions: System: Xubuntu 20.04.1 LTS (focal) Emacs: 27.1 Org: 9.4 LibreOffice: 6.4 Regards, br. Attachement: test.org, a faulty org file (with Byte Order Mark). $ file test.org test.org: UTF-8 Unicode (with BOM) text ------------------------------------------------------------------------ Emacs : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2020-10-29 Package: Org mode version 9.4 (9.4-29-g20374f-elpaplus @ /home/br/.emacs.d/elpa/org-plus-contrib-20201102/) current state: ============== (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-link-shell-confirm-function 'yes-or-no-p org-babel-after-execute-hook '(org-redisplay-inline-images) org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-odt-format-headline-function 'org-odt-format-headline-default-function org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-startup-folded 'content org-mode-hook '(my/org-mode-hook org-tempo-setup #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes #[0 "\301\211.\207" [imenu-create-index-function org-imenu-get-tree] 2] org-eldoc-load) org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"] org-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-babel-load-languages '((calc . t) (emacs-lisp . t) (sql . t) (perl . t) (shell . t)) org-html-text-markup-alist '((verbatim . "%s") (verbatim . "%s") (verbatim . "%s") (verbatim . "%s") (verbatim . "%s") (verbatim . "%s") (bold . "%s") (code . "%s") (italic . "%s") (strike-through . "%s") (underline . "%s") (verbatim . "%s")) org-ascii-format-drawer-function #[771 ".\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] org-agenda-loop-over-headlines-in-active-region nil org-src-lang-modes '(("arduino" . arduino) ("browser" . html) ("redis" . redis) ("php" . php) ("C" . c) ("C++" . c++) ("asymptote" . asy) ("bash" . sh) ("beamer" . latex) ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist) ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg) ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql)) org-src-preserve-indentation t org-occur-hook '(org-first-headline-recenter) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-todo-keywords '((sequence "TODO" "STARTED" "WAITING" "|" "DONE" "CANCELED")) org-support-shift-select t org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-babel-tangle-lang-exts '(("perl" . "pl") ("emacs-lisp" . "el") ("elisp" . "el")) org-export-before-parsing-hook '(org-attach-expand-links) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("eww" :follow org-eww-open :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302.Q.\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("mailto" :follow #[514 "\301\300\302.Q.\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("https" :follow #[514 "\301\300\302.Q.\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("http" :follow #[514 "\301\300\302.Q.\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("ftp" :follow #[514 "\301\300\302.Q.\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-latex-format-headline-function 'org-latex-format-headline-default-function org-export-allow-bind-keywords t org-link-elisp-confirm-function 'yes-or-no-p org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-tab-before-tab-emulation-hook '(org-tempo-complete-tag) org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-html-format-headline-function 'org-html-format-headline-default-function org-src-window-setup 'current-window org-indent-mode-turns-on-hiding-stars nil org-link-from-user-regexp "\\\\|\\" org-publish-project-alist '(("org" :base-directory "~/org" :base-extension "org" :publishing-directory "~/dev/www/cf.bodi/org" :recursive t :publishing-function org-html-publish-to-html :html-head-include-default-style nil :html-head-include-scripts nil) ("static" :base-directory "~/org/" :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" :publishing-directory "~/dev/www/cf.bodi/org/" :recursive t :publishing-function org-publish-attachment) ) ) --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=test.org #+TITLE: Lorem.org #+AUTHOR: Lorem Ipsum * Lorem Ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. --=-=-=--