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:43:25 +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 1NTEBi-00019J-U9 for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:43:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTEBe-000150-2l for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:43:34 -0500 Received: from [199.232.76.173] (port=41256 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTEBd-00014p-Ra for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:43:29 -0500 Received: from ey-out-1920.google.com ([74.125.78.150]:8210) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTEBd-0008BK-2a for emacs-orgmode@gnu.org; Fri, 08 Jan 2010 07:43:29 -0500 Received: by ey-out-1920.google.com with SMTP id 4so2966602eyg.34 for ; Fri, 08 Jan 2010 04:43:28 -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? In, fact, you can change it in the code I sent you: Add (if (equal opt "utf8") (setq opt "utf8x")) wight before (when opt I am still thinking about if and how I can add this in a stable way to the default code.... - Carsten - Carsten