all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: help-gnu-emacs@gnu.org
Subject: Re: set UTF-8 for a file (HTML)
Date: Sun, 10 Feb 2008 10:04:56 +0100	[thread overview]
Message-ID: <pcohcghb2rr.fsf@shuttle.math.ntnu.no> (raw)
In-Reply-To: mailman.7237.1202608828.18990.help-gnu-emacs@gnu.org

+ ken <gebser@speakeasy.net>:

> 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?

If you're using HTML mode, just specifying

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

in the head element of the file should do it.

Otherwise, a generic method for specifying the coding to emacs is
having -*- coding: utf-8 -*- in the first line of the file.  You should
typically protect that by putting in a comment, as follows:

<!-- -*- coding: utf-8 -*- -->

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


  parent reply	other threads:[~2008-02-10  9: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 ` set UTF-8 for a file (HTML) Tim X
2008-02-10  9:04 ` Harald Hanche-Olsen [this message]
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=pcohcghb2rr.fsf@shuttle.math.ntnu.no \
    --to=hanche@math.ntnu.no \
    --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.