From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Will Parsons Newsgroups: gmane.emacs.help Subject: Re: Understanding how to specify UTF-8 Date: 14 Apr 2017 23:37:16 GMT Message-ID: References: Reply-To: wbparsons@cshore.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1492213233 673 195.159.176.226 (14 Apr 2017 23:40:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 14 Apr 2017 23:40:33 +0000 (UTC) User-Agent: slrn/1.0.3 (CYGWIN_NT-6.1) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 15 01:40:28 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czApG-0008QP-Ok for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Apr 2017 01:40:26 +0200 Original-Received: from localhost ([::1]:54933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czApL-0008E2-1L for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Apr 2017 19:40:31 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 59 Original-X-Trace: individual.net +s3IjSO23cmeuauEggAGAwmvMZbmaKhbnvi8oodKZYnbuf6stO Cancel-Lock: sha1:o/uxx6cXQ30dPhOodgSe2sWeDlw= Original-Xref: usenet.stanford.edu gnu.emacs.help:219084 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112768 Archived-At: B. T. Raven wrote: > Hi Will. I decided to respond because of this observation in the latest > posting: > "They used to say emacs and vi are religions; these days they are > starting to seem like latin." Not completely - "Emacs" should be spelt "Emax" first ;) (And the plural, I suppose should be "emaces" rather than "emacsen".) > On 4/7/2017 18:43, Will Parsons wrote: >> I want to always use Unicode/UTF-8 unless otherwise specified. I've noticed >> that I've attempted to do this in my .emacs file in two separate ways on two >> separate platforms: >> >> 1) (setq-default buffer-file-coding-system 'utf-8-unix) >> >> 2) (set-language-environment "UTF-8") >> >> Both seem to work, but I'm wondering if there are subtle differences between >> the two that I should be aware of. > > I can't help with any subtlties but can only recommend that you add this > cookie to the beginning of the buffer: > > ;; -*- coding: utf-8 -*- Yes, I've employed that too. (Incidentally, I've been programming a lot in Ruby for some years now, and I was surprised to find that after inserting a copyright symbol (©) into one of my Ruby source files, that Emacs ruby-mode inserted a line containing '# coding: utf-8' at the top when the file was saved.) > I think it may be enough to save and reload the file into a new buffer > before adding exotic characters. > I also have these lines in my .emacs: > > (set-locale-environment "utf-8") > (set-language-environment 'utf-8) > (set-default-coding-systems 'utf-8) > (setq file-name-coding-system 'utf-8) > (setq buffer-file-coding-system 'utf-8) > (setq coding-system-for-write 'utf-8) > (set-keyboard-coding-system 'utf-8) > (set-terminal-coding-system 'utf-8) > (prefer-coding-system 'utf-8) > ;; (set-buffer-process-coding-system 'utf-8 'utf-8) > (modify-coding-system-alist 'process > "[cC][mM][dD][pP][rR][oO][xX][yY]" 'utf-8-dos) > > The line commented out caused a problem but I don't remember what it > was. My os w64 vers. 7 Wow. I should think that should cover all possibilities. I prefer to be a bit more minimalist than that though... Anyway, thanks - Vale Edwarde! -- Will