From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#28705: 25.3; [PATCH] Change prefered coding system for Japanese language environment Date: Fri, 6 Oct 2017 14:10:29 -0700 Organization: UCLA Computer Science Department Message-ID: <10392881-8d4e-87e1-0dfd-190aafef8239@cs.ucla.edu> References: <20171004.200254.1802538916766305777.yasu@utahime.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E74F2D925344536783BFA696" X-Trace: blaine.gmane.org 1507324274 11662 195.159.176.226 (6 Oct 2017 21:11:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Oct 2017 21:11:14 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Cc: 28705@debbugs.gnu.org To: Yasuhiro KIMURA Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 06 23:11:06 2017 Return-path: Envelope-to: geb-bug-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 1e0Zth-00028N-8X for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Oct 2017 23:11:05 +0200 Original-Received: from localhost ([::1]:47175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Zto-0005KY-8g for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Oct 2017 17:11:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Zth-0005K8-Bt for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2017 17:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Zte-0005Kc-2J for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2017 17:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0Ztd-0005JO-SP for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2017 17:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e0Ztd-0006XS-Jw for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2017 17:11:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20171004.200254.1802538916766305777.yasu@utahime.org> Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Oct 2017 21:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28705 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28705-submit@debbugs.gnu.org id=B28705.150732424125105 (code B ref 28705); Fri, 06 Oct 2017 21:11:01 +0000 Original-Received: (at 28705) by debbugs.gnu.org; 6 Oct 2017 21:10:41 +0000 Original-Received: from localhost ([127.0.0.1]:53636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0ZtJ-0006Wr-EO for submit@debbugs.gnu.org; Fri, 06 Oct 2017 17:10:41 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0ZtG-0006Wc-OQ for 28705@debbugs.gnu.org; Fri, 06 Oct 2017 17:10:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 591E8160052; Fri, 6 Oct 2017 14:10:31 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id xff8mQvyHv_v; Fri, 6 Oct 2017 14:10:30 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 29142160E51; Fri, 6 Oct 2017 14:10:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5ubIi6vaz0RQ; Fri, 6 Oct 2017 14:10:30 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0A3FA160052; Fri, 6 Oct 2017 14:10:30 -0700 (PDT) Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138023 Archived-At: This is a multi-part message in MIME format. --------------E74F2D925344536783BFA696 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the bug report. Would you please discuss the practical advantages of the proposed patch? Is the patch is for Japanese users who do not specify a locale via environment variables like LC_ALL? If so, how do they specify their preference to Emacs now, and how would this change affect behavior for them? And how do users specify their coding preference to other programs, such as "cat" and "diff"? I have the impression that Emacs users in Japan are gradually switching from EUC-JP to UTF-8. Is there some way to verify this? I know of website surveys like , which says that since 2010 UTF-8 has grown from 51% to 90% of websites whereas EUC-JP has shrunk from 0.7% to 0.3% worldwide. However, this issue is more about what encodings are used by keyboards and terminal displays in Japan (typically these are programs in windowing systems these days, as GNU/Linux consoles cannot handle enough characters to support Japanese). Is there some way to estimate this? A minor point: a change like this should be noted in the NEWS file, and the commit message should use the usual Emacs style. I'm attaching a copy of your patch with a revised commit message, along with another patch to mention this change in NEWS and to change affected documentation. I will ask for comment about this proposed change on the emacs-devel mailing list. --------------E74F2D925344536783BFA696 Content-Type: text/x-patch; name="0001-Change-preferred-Japanese-coding-system-to-UTF-8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Change-preferred-Japanese-coding-system-to-UTF-8.patch" >From 8484dc66eee6b78771fa3332e63ddec9d5022cd4 Mon Sep 17 00:00:00 2001 From: Yasuhiro KIMURA Date: Fri, 6 Oct 2017 13:07:41 -0700 Subject: [PATCH 1/2] Change preferred Japanese coding system to UTF-8 * lisp/language/japan-util.el (setup-japanese-environment-internal): Use utf-8 as preferred coding system instead of japanese-iso-8bit when system is not MS-Windows. And while I'm at it, fix comment to fit current implementation. (Bug#28705) Copyright-paperwork-exempt: yes. --- lisp/language/japan-util.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el index 988b925409..fb4b408cd3 100644 --- a/lisp/language/japan-util.el +++ b/lisp/language/japan-util.el @@ -29,11 +29,11 @@ ;;;###autoload (defun setup-japanese-environment-internal () - ;; By default, we use 'japanese-iso-8bit for file names. But, the + ;; By default, we use 'iso-2022-jp for default coding system. But, the ;; following prefer-coding-system will override it. (if (memq system-type '(windows-nt ms-dos cygwin)) (prefer-coding-system 'japanese-shift-jis) - (prefer-coding-system 'japanese-iso-8bit)) + (prefer-coding-system 'utf-8)) (use-cjk-char-width-table 'ja_JP)) (defconst japanese-kana-table -- 2.13.6 --------------E74F2D925344536783BFA696 Content-Type: text/x-patch; name="0002-Mention-Japanese-change-in-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Mention-Japanese-change-in-documentation.patch" >From fb3e73de90a7eb90ac979deca1f8bd32871bb608 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 6 Oct 2017 13:48:08 -0700 Subject: [PATCH 2/2] Mention Japanese change in documentation --- doc/emacs/mule.texi | 2 +- etc/NEWS | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 8a4d91f80b..d3f54f65c9 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -405,7 +405,7 @@ Language Environments coding system instead. For example, if the locale @samp{ja_JP.PCK} matches @code{japanese-shift-jis} in @code{locale-preferred-coding-systems}, Emacs uses that encoding even -though it might normally use @code{japanese-iso-8bit}. +though it might normally use @code{utf-8}. You can override the language environment chosen at startup with explicit use of the command @code{set-language-environment}, or with diff --git a/etc/NEWS b/etc/NEWS index 15661808c7..2a1218a4a8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -31,6 +31,10 @@ When you add a new item, use the appropriate mark if you are sure it applies, * Changes in Emacs 27.1 +** In Japanese environments that do not specify encodings and are not +based on MS-Windows, the default encoding is now utf-8 instead of +japanese-iso-8bit. + +++ ** New function 'logcount' calculates an integer's Hamming weight. -- 2.13.6 --------------E74F2D925344536783BFA696--