From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: encoding problem Date: Fri, 01 Jun 2012 14:20:10 -0400 Message-ID: <87d35ij3mt.fsf@norang.ca> References: <87mx4q0z95.fsf@free.fr> <87aa0pk4xy.fsf@norang.ca> <87aa0nphu9.fsf@ucl.ac.uk> <87hauvhuum.fsf@norang.ca> <29580.1338568312@alphaville> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaWSQ-0002Hn-TU for emacs-orgmode@gnu.org; Fri, 01 Jun 2012 14:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SaWSO-0006VH-Va for emacs-orgmode@gnu.org; Fri, 01 Jun 2012 14:20:18 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:32445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaWSO-0006V7-Rr for emacs-orgmode@gnu.org; Fri, 01 Jun 2012 14:20:16 -0400 In-Reply-To: <29580.1338568312@alphaville> (Nick Dokos's message of "Fri, 01 Jun 2012 12:31:52 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Julien Cubizolles Nick Dokos writes: > Bernt Hansen wrote: > >> Eric S Fraga writes: >>=20 >> > Bernt Hansen writes: >> > >> >> Julien Cubizolles writes: >> >> >> >>> I'm having a very strange problem with character encoding. I write a= ll >> >>> my text files with emacs, with non-ascii characters (I'm french). I = keep >> >>> a copy of many files (latex/org/...) on separate machines using >> >>> unison. Very often after a synchronization, the non-ascii charaters = are >> >>> completely displayed wrong (=C3=83=C2=A0 for =C3=A0, =C3=83=C2=A7 fo= r =C3=A7) in the org files, but >> >>> never in the latex files. >> >>> >> >>> I guess it's more an Emacs than org files but I can't see what's spe= cial >> >>> in the org files that makes them more prone to such errors. >> >>> >> >>> Is there a way to *fix* easily these corruptions on a file, ie searc= hing >> >>> for all "weird" characters to replace=C2=A0? >> >>> >> >>> How could I prevent this from happening again (checking/changing >> >>> character encoding maybe=C2=A0?) >> >>> >> >>> Thanks for your help, >> >>> >> >>> Julien. >> >> >> >> Hi Julien, >> >> >> >> I get prompts for encoding when saving/exporting (on Windows only) so= I >> >> put the following at the top of my org-files >> >> >> >> # -*- coding: utf-8 -*- >> >> >> >> which seems to fix the problem for me. Maybe this will help? >> > >> > I used to have this problem and it was incredibly annoying. I also >> > started adding the line Bernt suggests but I kept forgetting for new >> > files. I finally solved this problem by adding the following lines to >> > my emacs initialisation: >> > >> > #+begin_src emacs-lisp >> > (prefer-coding-system 'utf-8) >> > (set-charset-priority 'unicode) >> > (setq default-process-coding-system '(utf-8-unix . utf-8-unix)) >> > #+end_src >> > >> > I couldn't tell you which of these matter or whether they are all >> > necessary but I don't have these problems any longer so I haven't >> > investigated any further! >>=20 >> Thanks Eric! >>=20 >> I'll try this and drop my mode line setting in each org file. I still >> encounter this when archiving for the first time to a new file -- since >> I'm archive utf-8 content and the new target org file prompts for >> encoding with my current setup. >>=20 >> Regards, >> Bernt > > Isn't the setting of LANG used during initialization to set these things? > I have LANG set to en_US.UTF-8 and new buffers are in utf-8-unix > (except for mail composition buffers: they are in undecided-unix). > I'm pretty sure I'm not mucking with coding systems anywhere in my emacs > initialization otherwise. > > Nick Maybe - I'm having this issue on Windows... -Bernt