How to get support "βœ–", etc. In the Emacs shell buffer?

I start a process that, with an error, displays the symbol "βœ–" (as defined in Unicode). However, I don’t see an error when starting the process in the buffer of the Emacs shell (GNU Emacs distribution Aquamacs).

Usage: GNU Emacs 23.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) from 2011-03-18 on braeburn.aquamacs.org - Distribution of Aquamacs 2.2

How to get Emacs shell buffer to support such Unicode characters?

+6
source share
3 answers

To tell a single shell buffer to handle shell output as UTF-8, enter the command Cx RET p and enter "utf-8" when prompted "Coding system to output from the process:". When after that I asked "Coding system for input into the process:", I just type RET ; I never provide UTF-8 input directly to the shell.

Alternatively, to automatically get this behavior, put (prefer-coding-system 'utf8) in your .emacs file. In fact, this will cause UTF-8 to be used in some other contexts, which most people probably want.

+7
source

You can call a function like the following to create a shell that supports utf-8:

 (defun utf8-shell () "Create Shell that supports UTF-8." (interactive) (set-default-coding-systems 'utf-8) (shell)) 

This sets both input and output in UTF-8, so you can do (for example) the following:

 ~ $ echo "βœ–" βœ– 

If you want the shell to always open with utf-8 support, you can do the following:

 (defadvice shell (before advice-utf-shell activate) (set-default-coding-systems 'utf-8)) (ad-activate 'shell) 
+3
source

Take a look at this EmacsForMacOS page.

0
source

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


All Articles