all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* guide to emacs encoding?
@ 2006-01-14  9:42 no_one_reads_it
  2006-01-14 13:48 ` Peter Dyballa
  2006-01-15  2:45 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: no_one_reads_it @ 2006-01-14  9:42 UTC (permalink / raw)


Hi there,

I often come across problems when using files that have been written by
other people. Mostly it's french texts and as those people use
different encodings than I do, accented characters aren't displayed
correctly or I get lots of ^M escape caracters instead of carriage
return. I would like to know whether there is a guide to how one can
handle different encodings using gnu emacs on a linux system.

Thanks for any hint
Matthias Knelangen
matthias at knelangen dot de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: guide to emacs encoding?
  2006-01-14  9:42 guide to emacs encoding? no_one_reads_it
@ 2006-01-14 13:48 ` Peter Dyballa
  2006-01-15  2:45 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2006-01-14 13:48 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 14.01.2006 um 10:42 schrieb no_one_reads_it@gmx.net:

> I often come across problems when using files that have been  
> written by
> other people. Mostly it's french texts and as those people use
> different encodings than I do, accented characters aren't displayed
> correctly or I get lots of ^M escape caracters instead of carriage
> return. I would like to know whether there is a guide to how one can
> handle different encodings using gnu emacs on a linux system.


There is: in GNU Emacs' info system. There is too the "Options" menu,  
which has "Mule (Multilingual Environment)" that leads to some other  
entries, for example "Set Coding Systems." You can choose some other  
entry there, for example "Describe Coding System" and choose one. In  
The *Help* buffer you'll find some hyper links into the info  
system ... for example in 'International' or 'International Character  
Set Support' -- they share some text.

It's helpful to have an environment variable like LANG set. GNU Emacs  
will then set a few things right and you would not need to set for  
example:

	(set-language-environment		'German)
	(setq default-file-name-coding-system	'utf-8)
	(setq file-name-coding-system		'utf-8)
	(setq default-buffer-file-coding-system 'iso-latin-9-unix))
	(set-default-coding-systems		'mac-roman-unix)
	;(setq mac-keyboard-text-encoding	 kTextEncodingISOLatin1)
	(set-keyboard-coding-system		'sjis-mac)
	(set-clipboard-coding-system		'sjis-mac)
	(prefer-coding-system			'mac-roman-unix)
	(modify-coding-system-alist	 'file "\\.tex\\'" 'iso-latin-9-unix)
	(modify-coding-system-alist	 'process "\\*[Ss][Hh][Ee][Ll][Ll].*\\'"  
'utf-8-unix)
	;(set-buffer-process-coding-system	'utf-8 'utf8)

Some of the values used here are non-sense. At least you'll find  
explanations for the variables or the functions.

--
Mit friedvollen Grüßen

   Pete

Ce qui été compris n'existe plus.    (Paul Eluard)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: guide to emacs encoding?
  2006-01-14  9:42 guide to emacs encoding? no_one_reads_it
  2006-01-14 13:48 ` Peter Dyballa
@ 2006-01-15  2:45 ` Stefan Monnier
  2006-01-15  7:30   ` Matthias Knelangen
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2006-01-15  2:45 UTC (permalink / raw)


> I often come across problems when using files that have been written by
> other people.  Mostly it's French texts and as those people use
> different encodings than I do, accented characters aren't displayed
> correctly or I get lots of ^M escape caracters instead of carriage
> return.  I would like to know whether there is a guide to how one can
> handle different encodings using gnu emacs on a linux system.

Depends on the specifics.  Based on your email address, I'd guess you
normally write in German, but French and German typically use the same
encoding (latin-1 or latin-9) so there shouldn't be any problem.  OTOH you
mention ^M issues, so maybe your French texts come from Windows and for some
reason Emacs doesn't handle that correctly.  Also Windows uses variants
of latin-1 and latin-9, so you may be seeing chars that are not in your
own encoding.

The only general answer is to use C-x RET c before opening the
problematic files.  A better one is to use file-coding-system-alist,
assuming all the problematic files have something in common in their
filename (e.g. they're all in the same directory).

But if you can give us more details (e.g. your locale, and some example of
problematic file and what it looks like on screen), we can probably do
better,


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: guide to emacs encoding?
  2006-01-15  2:45 ` Stefan Monnier
@ 2006-01-15  7:30   ` Matthias Knelangen
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Knelangen @ 2006-01-15  7:30 UTC (permalink / raw)


Hi again,
well I have solved the problem for my actual file (was latin-9 encoding
and I removed the ^Ms manually), but still this is trial-and-error,
because I don't know exactly what system the file was encoded with. So
how can I find out the encoding of a file? And is there a nice little
guide that explains the use of the different set-...-coding options?
I do write texts in german, french and english, yes I'm german but
living in France and my locale is  en_US.UTF-8.

regards
Matthias Knelangen
matthias at knelangen dot de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-15  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-14  9:42 guide to emacs encoding? no_one_reads_it
2006-01-14 13:48 ` Peter Dyballa
2006-01-15  2:45 ` Stefan Monnier
2006-01-15  7:30   ` Matthias Knelangen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.