GNU bug report logs - #47767
28.0.50; japanese-hankaku unnatural or misconversion results

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Wed, 14 Apr 2021 09:03:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; japanese-hankaku unnatural or misconversion results
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.")
-> "A、 B、 C。"

(japanese-hankaku "A,B,C.")
-> "A、B、C。"

They should be "A, B, C." 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




This bug report was last modified 4 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.