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: 21 Apr 2017 17:36:06 GMT Message-ID: References: Reply-To: wbparsons@cshore.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1492796428 29968 195.159.176.226 (21 Apr 2017 17:40:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Apr 2017 17:40:28 +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 Fri Apr 21 19:40:25 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 1d1cXg-0007fW-Sa for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Apr 2017 19:40:24 +0200 Original-Received: from localhost ([::1]:60786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1cXl-00014D-2w for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Apr 2017 13:40:29 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-X-Trace: individual.net iYdJG8G50BxsZrC3JBdvHgDOnJuVBqeZ8aYchW4PcJ/SfsKnY7 Cancel-Lock: sha1:V4L+tcko30QZ3EpRZd9VqXK8/18= Original-Xref: usenet.stanford.edu gnu.emacs.help:219097 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:112843 Archived-At: Jason Rumney wrote: > 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 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. > > The first only sets the default coding system for Files. > > The second sets it for for everything, including system clipboard, file names, process I/O ... > > On modern GNU/Linux, Mac or other Posix based OS's, you probably want everything in UTF-8, so the latter is correct. > > On Windows, the system itself does not support UTF-8 fully, so the former is safer. For clipboard and file names on Windows, the latest versions of Emacs 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 may support UTF-8 I/O, but native Windows apps (including the cmd.exe shell) can have severe difficulties with it. Thank you for this detailed answer. Interestingly enough, I have them reversed in my Unix vs Windows configurations. -- Will