Subject: 28.0.50; japanese-hankaku unnatural or misconversion results

From: Kazuhiro Ito <[email-masked]>
Date: Wed, 14 Apr 2021 18:01:46 +0900

1. japanese-hankaku[-region] with ASCII-ONLY option converts Japanese
panctuation characters and prolonged sound mark to ascii.

(japanese-hankaku "ケーキ、ドーナツ。" t)
-> "ケ-キ,ド-ナツ."

the result is very unnatural because "ー", "、" and "。" are normally
used among Japanese characters which are not converted to hankaku in
this case.  I hope they are kept as is (the result should be
"ケーキ、ドーナツ。").

2. japanese-hankaku[-region] without ASCII-ONLY option and
japanese-zenkaku[-region] fails to convert Latin punctuations.

(japanese-zenkaku "A, B, C.")
-> "Ａ、　Ｂ、　Ｃ。"

(japanese-hankaku "Ａ，Ｂ，Ｃ．")
-> "A､B､C｡"

They should be "Ａ，　Ｂ，　Ｃ．" and "A,B,C." respectively.

Below patch fixes problems.

diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el
index 3f1fb2b749..8b80599d99 100644
--- a/lisp/language/japan-util.el
+++ b/lisp/language/japan-util.el
@@ -96,9 +96,9 @@ japanese-kana-table
 	  (put-char-code-property jisx0201 'jisx0208 katakana)))))
 
 (defconst japanese-symbol-table
-  '((?\　 ?\ ) (?， ?, ?､) (?． ?. ?｡) (?、 ?, ?､) (?。 ?. ?｡) (?・ nil ?･)
+  '((?\　 ?\ ) (?， ?,) (?． ?.) (?、 nil ?､) (?。 nil ?｡) (?・ nil ?･)
     (?： ?:) (?； ?\;) (?？ ??) (?！ ?!) (?゛ nil ?ﾞ) (?゜ nil ?ﾟ)
-    (?´ ?') (?｀ ?`) (?＾ ?^) (?＿ ?_) (?ー ?- ?ｰ) (?— ?-) (?‐ ?-)
+    (?´ ?') (?｀ ?`) (?＾ ?^) (?＿ ?_) (?ー nil ?ｰ) (?— ?-) (?‐ ?-)
     (?／ ?/) (?＼ ?\\) (?〜 ?~)  (?｜ ?|) (?‘ ?`) (?’ ?') (?“ ?\") (?” ?\")
     (?\（ ?\() (?\） ?\)) (?\［ ?\[) (?\］ ?\]) (?\｛ ?{) (?\｝ ?})
     (?〈 ?<) (?〉 ?>) (?\「 nil ?\｢) (?\」 nil ?\｣)

-- 
Kazuhiro Ito