emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org, Julien Cubizolles <j.cubizolles@free.fr>
Subject: Re: encoding problem
Date: Fri, 1 Jun 2012 17:46:46 +0930	[thread overview]
Message-ID: <87aa0nphu9.fsf@ucl.ac.uk> (raw)
In-Reply-To: <87aa0pk4xy.fsf@norang.ca> (Bernt Hansen's message of "Wed, 30 May 2012 12:29:45 -0400")

Bernt Hansen <bernt@norang.ca> writes:

> Julien Cubizolles <j.cubizolles@free.fr> 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

  reply	other threads:[~2012-06-01  8:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  9:55 encoding problem Julien Cubizolles
2012-05-30 16:29 ` Bernt Hansen
2012-06-01  8:16   ` Eric S Fraga [this message]
2012-06-01 16:15     ` Bernt Hansen
2012-06-01 16:31       ` Nick Dokos
2012-06-01 18:20         ` Bernt Hansen
2012-06-01 18:35           ` Nick Dokos
2012-06-02  8:49     ` Julien Cubizolles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aa0nphu9.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=j.cubizolles@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).