Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes
Accepted

How encode to UTF-8 content of buffer?

Emacs decodes a text file with an appropriate coding system when you open it with find-file. If you have to tell emacs for some reason what coding system it should use for decoding the file you should ...
Tobias's user avatar
  • 33.3k
3 votes
Accepted

What utf-8 settings need to be explicitly set in dot emacs

None of those are necessary as utf-8 is the default for everything. Furthermore, even if you do want to change the defaults, you should not use the code as you pasted it; it is incomplete. It changes ...
db48x's user avatar
  • 18.3k
3 votes
Accepted

Emacs crash because of special utf-8 character

I see the same crash. Quoting the likely-looking answer from @rpluim: This is the infamous Xft + emoji bug. Either upgrade to emacs-27, or to an emacs-26 build compiled with Cairo support. – rpluim ...
nealmcb's user avatar
  • 194
3 votes

How can I find non-displayable unicode characters in a buffer?

Robert Pluim proposed already a solution. The credit for describe-char-display belongs to him. Here I detail what I meant in my comment to his answer. I've got the impression that this solution is ...
Tobias's user avatar
  • 33.3k
3 votes

How encode to UTF-8 content of buffer?

Your problem has nothing to do with utf-8. Your screenshot of Notepad++ indicates Windows-1251 encoding for that file as you can see at the right end of the status line of Notepad++. Therefore you ...
Tobias's user avatar
  • 33.3k
3 votes
Accepted

How to set Chinese fonts in modern Emacs

https://github.com/tumashu/chinese-fonts-setup If you google Chinese font emacs, this is the first result. Basic setup: (require 'chinese-fonts-setup) (chinese-fonts-setup-enable) ; enable setup (...
chen bin's user avatar
  • 4,877
3 votes
Accepted

org-mode how to export raw text no formatting?

You could try pandoc, e.g. with ox-pandoc. The command line would be like this: pandoc -t plain -o outfile.txt YOUR_ORG_FILE.org The output is: HEADER 1 Lorem ipsum dolor sit amet, consectetur ...
tarleb's user avatar
  • 473
2 votes

^M character suddenly appearing upon opening file

Are you sure every line ends with a ^M? If just a single one doesn't then you will get the symptoms you describe. You can search for such lines with isearch-forward-regexp, e.g. escape ctrl-s [ ^ ...
icarus's user avatar
  • 1,924
2 votes

Some UTF-8 characters break my ansi-term. How to fix it?

The \370\272 is Emacs trying to show the character using octal escapes. See the Emacs manual, node Text Display, and see the Elisp manual, node Usual Display. You can set variable ctl-arrow to t to ...
Drew's user avatar
  • 77.9k
2 votes

What is Emacs' default character encoding for saving files? If it is UTF-8, is a BOM (Byte Order Mark) inserted?

It depends. Chapter 22.2 Language Environments of the Emacs Manual is the best place to start. The language environment controls how files are read and written, how input is handled, etc. The default ...
db48x's user avatar
  • 18.3k
2 votes
Accepted

How can I find non-displayable unicode characters in a buffer?

It might be better to find fonts that can be used to display those characters, but if you really want to remove them: (defun delete-non-displayable () (interactive) (require 'descr-text) ;; for `...
rpluim's user avatar
  • 5,325
2 votes

How to produce UTF8 info file with makeinfo on osx?

The solution is to: Install makeinfo with homebrew raoul@MacBook-Pro-de-Raoul oef-mode % brew install texinfo raoul@MacBook-Pro-de-Raoul oef-mode % brew info texinfo texinfo: stable 6.7 (bottled) [...
Raoul HATTERER's user avatar
2 votes
Accepted

How to make a change to the variable `glasses-separator` take effect?

The commentary in glasses.el says: ;; If you set any of the variables `glasses-separator' or `glasses-face' after ;; glasses.el is loaded in a different way than through customize, you ;; should call ...
NickD's user avatar
  • 30.6k
2 votes
Accepted

Quail Rules UTF8 behaviour

Unfortunately using quail to convert a character from beyond the Basic Latin and Latin-1 Supplement blocks (i.e. anything with a codepoint above 255) is not possible. Firstly, the quail-translation-...
Adam's user avatar
  • 86
1 vote

How can I load a large file in literal mode, but also as UTF-8?

You cannot. That would be contrary to what Emacs means by "literal". See C-hig (elisp)Disabling Multibyte By default, Emacs starts in multibyte mode: it stores the contents of buffers and ...
phils's user avatar
  • 51.6k
1 vote

Problem with UTF-8 characters in magit buffers

As comented by @db48x, the correct anwer for this is add to my early-init.el file this setting: (set-language-environment 'utf-8) This is also the suggestion in doom emacs configuration: https://...
anquegi's user avatar
  • 749
1 vote
Accepted

utf-8-unix versus utf-8-dos in Emacs on Windows. Which is more advantageous and why?

The difference between utf-8-unix and utf-8-dos are the characters signaling a newline. In unix this is the line feed or LF character whereas in dos a newline is signaled by a carriage return ...
evilsetg's user avatar
1 vote
Accepted

Bibtex entry name from doi and character corruption

EDIT from the answer here we find that we can also use url-insert-file-contents(-literally) to obtain the body of the response Using this, we can simplify your function to (defun get-bibtex-from-doi (...
dalanicolai's user avatar
  • 7,865
1 vote
Accepted

Enable UTF8 in Python comint processes

This is purely a Python problem that has nothing to do with Emacs. Read the documentation for sys.stdout: On Windows, UTF-8 is used for the console device. Non-character devices such as disk files ...
db48x's user avatar
  • 18.3k
1 vote

Emacs client doesn't recognize non-ascii input

Does this fix the problem? (defun my-terminal-keyboard-coding-system (&optional frame) "Force the terminal `keyboard-coding-system' to be `utf-8'. Prevents terminal frames using a coding ...
phils's user avatar
  • 51.6k
1 vote

Tamil characters show as garbage in shell buffer but ok in files

Diagnosis Clearly at this point we have only insufficient data. Anyways... here's my tentative diagnosis LANG is set en_IN (no utf8) in /etc/default/locale; LANGUAGE too is set there to en_IN:en ...
Rusi's user avatar
  • 333
1 vote
Accepted

Display glyphs instead of codepoints

Not clear if you want this to be done "on the fly" as part of the rendering or if you'd be OK with modifying the buffer. If the latter, then something like: (defun sm-replace-codepoints () (...
Stefan's user avatar
  • 26.5k
1 vote

UTF-8 error everytime Org-gcal sync entries

After upgrading request package to the latest version this is working for me. See this https://github.com/kidd/org-gcal.el/issues/41
sdaaish's user avatar
  • 53
1 vote
Accepted

Revert buffer with coding system

As I already tried to describe in my comment: (add-hook 'org-mode-hook (lambda () (revert-buffer-with-coding-system "utf-8"))) cannot work because revert-buffer-with-coding-system indirectly runs org-...
Tobias's user avatar
  • 33.3k
1 vote
Accepted

Does `<meta charset=utf-8 />` obviate `-*- coding: utf-8 -*-` in an HTML file?

The function sgml-html-meta-auto-coding-function selects the coding system on the basis of the meta tag. It only checks the meta tag if the document begins with <!doctype html> or with <html&...
Tobias's user avatar
  • 33.3k
1 vote

Emacs displays Hebrew text incorrectly

This issue has now been fixed in the latest git version of Emacs thanks to help from Eli Zaretskii.
Edman's user avatar
  • 1,229
1 vote
Accepted

Org-ellipsis displayed inorrectly for some headlines only

I finally found the answer. It is due to the fact that org considers blank lines to be part of the headline's content by default. Following this Q&A, I added (setq org-cycle-separator-lines -1) ...
Joseph R.'s user avatar
  • 175
1 vote

utf-8 characters with eshell, eshell-visual-subcommands, and git

I found the lines ;; display of certain characters and control codes to UTF-8 (defun my-term-use-utf8 () (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix)) (add-hook 'term-exec-hook 'my-...
Tobias's user avatar
  • 33.3k
1 vote

Get multibyte string byte

Solution presented in this answer is not perfect. It meets O(1) criteria only for ASCII string inputs. ;;; -*- lexical-binding: t -*- (defun utf8-decode-byte (ch n ch-size) "Returns integer (...
Iskander Sharipov's user avatar
1 vote
Accepted

Incremental Search on UTF-8 in Julia Mode

AFAIK julia-mode's ad-hoc way to enter non-ASCII characters does not prevent you from using Emacs's input-methods such as C-u C-\ TeX RET, so you can simply use that. Of course, you can additionally ...
Stefan's user avatar
  • 26.5k

Only top scored, non community-wiki answers of a minimum length are eligible