Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to read one C++ head file which has some Chinese and was encoded using utf-8.

Emacs should recognize this encoding, but it turns out:

enter image description here

Then, I changed it to text-mode, it works:

enter image description here

I also tested for python-mode, lisp-mode, etc, all works except c-mode, c++-mode, java-mode, seems there are something wrong with cc-mode, or the cc-vars?

Please help me if you know how to fix this weird problem.

share|improve this question

I posted this question to stackoverflow, and got an answer.

It's not because of the encoding, in c-mode, comments are using italic font, but the font I use is lack of italic Chinese font, so, can't recognize the utf-8 Chinese character.

Simple do this

(add-hook 'c-mode-common-hook
          (lambda () 
            (make-face-unitalic 'font-lock-comment-face)))

Problem solved.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.