From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Exporting non utf8 org documents Date: Fri, 8 Jan 2010 13:39:08 +0100 Message-ID: References: <87my1tcu59.fsf@missioncriticalit.com> <6B5F0F7A-F055-435F-ADE2-846E99649B1D@gmail.com> <87zl4o3ha1.fsf@missioncriticalit.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTE7Z-0005Bc-Ky for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:39:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTE7U-00057t-VK for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:39:17 -0500 Received: from [199.232.76.173] (port=41138 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTE7U-00057e-MO for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:39:12 -0500 Received: from mail-ew0-f224.google.com ([209.85.219.224]:48897) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTE7U-0006To-87 for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:39:12 -0500 Received: by ewy24 with SMTP id 24so22734484ewy.26 for ; Fri, 08 Jan 2010 04:39:10 -0800 (PST) In-Reply-To: <87zl4o3ha1.fsf@missioncriticalit.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Francesco Pizzolante Cc: mailing-list-org-mode On Jan 8, 2010, at 1:36 PM, Francesco Pizzolante wrote: > Hi Carsten, > >> here is a possible solution: >> >> Please get the latest git version of org-mode. Then put the >> following code >> into >> .emacs: >> >> (defun my-org-export-latex-fix-inputenc () >> "Set the codingsystem in inputenc to what the buffer is." >> (let* ((cs buffer-file-coding-system) >> (opt (latexenc-coding-system-to-inputenc cs))) >> (when opt >> (goto-char (point-min)) >> (while (re-search-forward "\\\\usepackage\\[\\(.*?\\)\\] >> {inputenc}" >> nil t) >> (goto-char (match-beginning 1)) >> (delete-region (match-beginning 1) (match-end 1)) >> (insert opt)) >> (save-buffer)))) >> >> (eval-after-load "org-latex" >> '(add-hook 'org-export-latex-after-save-hook >> 'my-org-export-latex-fix-inputenc)) >> >> Let me know how it goes..... > > Thanks for your solution. > > I've tested with both latin1 and utf8 Org buffers and I get the > correct > encoding passed to LaTeX in both cases. > > Regarding the utf8 encoding, I had a remark in my first message, > which was: > >>> In addition, Org should use the `utf8x' option (instead of `utf8') >>> which >>> enables to handle unbreakable spaces (useful in french). > > Could you change that too? no, because utf8x is not in all TeX distributions, so that is too risky. I was considering to make it configurable, though. - Carsten > > Thanks a lot, > Francesco - Carsten