all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: set UTF-8 for a file (HTML)
Date: Sun, 10 Feb 2008 15:04:23 +1100	[thread overview]
Message-ID: <87myq9h2yg.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.7237.1202608828.18990.help-gnu-emacs@gnu.org

ken <gebser@speakeasy.net> writes:

> I'm editing an HTML file (in emacs, of course) and want to preserve the
> utf-8 encoding when the file is opened in subsequent sessions.  I know I
> can put a line at the top of the file which will set a variable in emacs
> whenever the file is opened.  So what should this line say to specify that
> the file is encoded in utf-8?
>

What version of emacs are you running? Emacs 22 has much better utf-8
support than earlier versions. 

The coding used/preferred by emacs is influenced by your locale
setting. If your not running a utf-8 locale, you probably will need to
set some variables (easiest via customize). What variables depends on
the version of emacs your running. 

In emacs 22, if you have a utf-8 locale set, emacs will use that as its
preferred coding and you shouldn't need to do anything unless the file
has already been created in another coding system. Emacs works quite
hard to try and not change the coding used on any file it
edits. Creating a new file will use the default/preferred coding and if
you have'nt set that manually, will default to what your locale setting
is. 

I do have the following in my .emacs 

 '(current-language-environment "UTF-8")

and a locale setting of en_AU.utf-8

Note that in emacs22 you can tell if emacs is using a utf-8 encoding by
the existance of a 'u' in the mode line (left hand side, second
character).

Tim


-- 
tcross (at) rapttech dot com dot au


       reply	other threads:[~2008-02-10  4:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.7237.1202608828.18990.help-gnu-emacs@gnu.org>
2008-02-10  4:04 ` Tim X [this message]
2008-02-10  9:04 ` set UTF-8 for a file (HTML) Harald Hanche-Olsen
2008-02-10 20:09   ` display of ancient Greek chars (after: Re: set UTF-8 for a file (HTML)) ken
2008-02-10 23:11     ` Peter Dyballa
2008-02-12  0:17       ` ken
2008-02-12  9:25         ` Peter Dyballa
2008-02-10  1:59 set UTF-8 for a file (HTML) ken
2008-02-10  9:03 ` Peter Dyballa

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

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

  git send-email \
    --in-reply-to=87myq9h2yg.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /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 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.