[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] encoding problem
From: |
Eric S Fraga |
Subject: |
Re: [O] encoding problem |
Date: |
Fri, 1 Jun 2012 17:46:46 +0930 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) |
Bernt Hansen <address@hidden> writes:
> Julien Cubizolles <address@hidden> writes:
>
>> I'm having a very strange problem with character encoding. I write all
>> 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 (à for à, ç for ç) 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 special
>> 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 searching
>> for all "weird" characters to replace ?
>>
>> How could I prevent this from happening again (checking/changing
>> character encoding maybe ?)
>>
>> 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!
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.10-630-g4144c5.dirty