How do I convert U+301C to 0x8160 during Unicode→ CP932 conversion?

Asked 2 years ago, Updated 2 years ago, 94 views

I am using GNU Emacs 24.4.1 (i686-pc-cygwin) of 2015-02-01 on gnupack.
Wave dash (U+301C) cannot be converted when converting Unicode character codes such as UTF-8 to CP932.

I found it inconvenient that the wave dash (0x8160) of CP932 is not converted to the wave dash (0x8160) of CP932 even though I have to accept it as long as I use Windows.

How do I configure Unicode wave dash (U+301C) to convert to CP932 wave dash (0x8160)?

# I thought I could do it by rewriting:decode-translation-table in coding-system-put, but I don't know how to handle character codes or Emacs Lisp inside Emacs...

emacs

2022-09-30 13:57

1 Answers

Below is a summary of Heliac2001's answers plus my own supplement.

<pre><code>;; Unicode (internal code) → Set to convert wave dash (U+301C) to wave dash (0x8160) when converting CP932 ;; Characters with conversion problems similar to wave dashes are also changed. ;; The target characters are defined in "lisp/language/Japanese.el" ;; See japanese-ucs-jis-to-cp932-map. (coding-system-put'cp932:encode-translation-table (get'Japanese-ucs-jis-to-cp932-map'translation-table))


2022-09-30 13:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.