emacs 텍스트 모드 UTF-8 문자

emacs 텍스트 모드 UTF-8 문자

-nw텍스트 모드(시작 옵션)에서 유니코드 문자를 직접 표시하기 위해 emacs(버전 24.4.1)를 얻을 수 없습니다 . 이스케이프된 형식으로 출력 ä됩니다 \344. 파일을 저장하면 ISO-8859내 시스템 로케일이 .even 으로 인코딩됩니다 en_US.UTF-8.

터미널 자체는 유니코드 문자를 표시할 수 있습니다.외부예를 들어, bash에서는 ä가 됩니다 ä. (없이) emacs X 애플리케이션에서도 작동합니다 -nw.

저는 Arch Linux 3.19.3-3에서 gnome-shell 3.16.0-2를 실행하고 있습니다 xterm -u8(동일한 결과).uxterm

localectl산출:

   System Locale: LANG=en_US.UTF-8
       VC Keymap: sv-latin1
      X11 Layout: se
       X11 Model: pc104

locale산출:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

유일한 문제 영역은 터미널 모드의 emacs이므로 그것이 문제인 것 같습니다. 어떤 아이디어가 있나요?

고쳐 쓰다:

~/.emacs:

(prefer-coding-system       'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)

(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-names-vector
   ["#2d3743" "#ff4242" "#74af68" "#dbdb95" "#34cae2" "#008b8b" "#00ede1" "#e1e1e0"])
 '(current-language-environment "UTF-8")
 '(custom-enabled-themes (quote (manoj-dark)))
 '(font-use-system-font t)
 '(inhibit-startup-screen t)
 '(tool-bar-mode nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

파일의 모든 줄을 주석 처리하려고 시도했지만 그 이후의 결과는 동일합니다.

답변1

약간의 조정 끝에 Emacs 관련이 아니라 시스템 관련이라는 것을 알았습니다. OP에서 본 것처럼 내 로케일이 어떻게 든 엉망이 된 것 같습니다.

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

문제를 해결하기 위해 내가 한 일은 다음과 같습니다.

에서 /etc/locale.gen표시된 줄의 주석 처리를 제거하거나 추가합니다 en_US.UTF-8 UTF-8. 주석 처리되지 않은 유일한 줄인지 확인하세요. UTF-8이들 중 하나를 사용하려면 다른 설정에서도 작동해야 합니다. 무차별 대입 방법은 다음과 같습니다.

$ sudo bash -c 'echo en_US.UTF-8 UTF-8 > /etc/locale.gen'

그런 다음 로케일을 생성하여 시스템 구성에 저장합니다.

$ sudo locale-gen
$ sudo bash -c 'locale > /etc/locale.conf'

재부팅하지 않고도 설정을 업데이트할 수 있을지도 모르지만 방법을 찾지 못했습니다.

관련 정보