Subject: 30.0.50; Preferable choice of coding system on Japanese
From: Kazuhiro Ito <[email-masked]>
To: [email-masked]
Date: Sat, 02 Mar 2024 08:44:56 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

When I call (set-language-environment "Japanese"), below code in
lisp/language/japan-util.el is called.

(defun setup-japanese-environment-internal ()
  (prefer-coding-system (if (memq system-type '(windows-nt ms-dos cygwin))
			    'japanese-shift-jis
			  'utf-8))
  (use-cjk-char-width-table 'ja_JP))

1. japanese-shift-jis is not proper coding system on Cygwin.
2. We have japanese-cp932, more appropriate coding system for DOS/Windows.

PLease see below patch.

diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el
index 93e8ab24971..f3ec44bf75d 100644
--- a/lisp/language/japan-util.el
+++ b/lisp/language/japan-util.el
@@ -29,8 +29,8 @@
 
 ;;;###autoload
 (defun setup-japanese-environment-internal ()
-  (prefer-coding-system (if (memq system-type '(windows-nt ms-dos cygwin))
-			    'japanese-shift-jis
+  (prefer-coding-system (if (memq system-type '(windows-nt ms-dos))
+			    'japanese-cp932
 			  'utf-8))
   (use-cjk-char-width-table 'ja_JP))

-- 
Kazuhiro Ito