From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.help Subject: Re: Understanding how to specify UTF-8 Date: Fri, 21 Apr 2017 02:28:45 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1492767030 24452 195.159.176.226 (21 Apr 2017 09:30:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Apr 2017 09:30:30 +0000 (UTC) Injection-Date: Fri, 21 Apr 2017 09:28:45 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 21 11:30:22 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 1d1UtS-00069W-56 for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Apr 2017 11:30:22 +0200 Original-Received: from localhost ([::1]:58167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1UtW-00032k-7u for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Apr 2017 05:30:26 -0400 X-Received: by 10.237.36.232 with SMTP id u37mr5464138qtc.85.1492766925810; Fri, 21 Apr 2017 02:28:45 -0700 (PDT) X-Received: by 10.157.21.114 with SMTP id z47mr266803otz.5.1492766925750; Fri, 21 Apr 2017 02:28:45 -0700 (PDT) Original-Path: usenet.stanford.edu!t52no2666903qtb.0!news-out.google.com!k36ni2139qtb.0!nntp.google.com!c45no4495378qtb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=121.122.94.196; posting-account=pYxWjwkAAACsHSUNDoi5N05LVCTP7PVM Original-NNTP-Posting-Host: 121.122.94.196 Original-Xref: usenet.stanford.edu gnu.emacs.help:219095 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:112832 Archived-At: On Saturday, 8 April 2017 07:43:58 UTC+8, Will Parsons wrote: > I want to always use Unicode/UTF-8 unless otherwise specified. I've noti= ced > that I've attempted to do this in my .emacs file in two separate ways on = two > separate platforms: >=20 > 1) (setq-default buffer-file-coding-system 'utf-8-unix) >=20 > 2) (set-language-environment "UTF-8") >=20 > Both seem to work, but I'm wondering if there are subtle differences betw= een > the two that I should be aware of. The first only sets the default coding system for Files. The second sets it for for everything, including system clipboard, file nam= es, process I/O ... On modern GNU/Linux, Mac or other Posix based OS's, you probably want every= thing in UTF-8, so the latter is correct.=20 On Windows, the system itself does not support UTF-8 fully, so the former i= s safer. For clipboard and file names on Windows, the latest versions of Em= acs will use Unicode regardless of what you specify for the coding system, = it is really only process I/O that is the problem - Cygwin and Mingw apps m= ay support UTF-8 I/O, but native Windows apps (including the cmd.exe shell)= can have severe difficulties with it.