How to have Chinese characters displayed properly in emacs buffer?

What happened?

In a emacs buffer, when I copied Chinese text (properly displayed) from web or notepad, the Chinese text becomes garbage display, unrecognizable. What could be the root cause of the problem?

I investigated the encoding used by MS Notepad is UTF-8, which display the Chinese text properly. I tired a few UTF-8 encodings for the emacs buffer with the text pasted, but still got garbage display.

What did you expect to happen?

The Chinese text should be displayed the same as I copied from web of MS Notepade.

Steps to reproduce

  1. Go to Genesis 1 CUVS - 起 初 ,   神 创 造 天 地 。 - Bible Gateway
  2. Copy the Chinese text from the above to a emacs buffer
  3. To have the Chinese text properly displayed

System information

Loading data dump...

You probably need to configure a font for Chinese:

(dolist (script '(cjk-misc han))
  (set-fontset-font t script "Noto Sans SC"))

Replace the family string with one you have installed.

1 Like