Strange characters in ansi-term in emacs

I wrote a C ++ program, and when I compiled it with g ++ in ansi-term, I got some weird characters:

enter image description here

If necessary, the error was that I did not declare the variable n. How can i fix this?

+2
source share
3 answers

Oh! Tested this ...

(setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8) 

and the problem is solved !!!

+4
source

It looks like the gcc output contains UTF-8 smart quotes, and your terminal is not configured to display UTF-8. A simple workaround is to use locale , which does not support smart quotes inside Emacs, which forces gcc return to ASCII quotes with plain jane; a more complicated solution would be to set the terminal mode in the Ansi-Term buffer to display them correctly.

+3
source

These are most likely color escape sequences. emacs has a mode that can be enabled using the ansi-color-for-comint-mode-on function.

+1
source

Source: https://habr.com/ru/post/1490797/


All Articles