Hot answers tagged

3

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 have to select windows-1251 and not utf-8 as coding system. You can use my other answer for a first try with windows-1251 encoding. Note, that 8-bit encodings can ...


3

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 do so before you open the file. You can set the coding system for the next command with Options -> Multilingual Environment -> Set Coding Systems -> For Next ...


3

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 `describe-char-display' (save-excursion (goto-char (point-min)) (while (not (eobp)) (if (or (eolp) (looking-at "\t") (...


3

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 adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Header 2 code block


2

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 see the characters displayed otherwise, using face escape-glyph. But if your font does not enable showing those characters as you expect (Cyrillic) then, well, ...


2

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 (cfs-set-spacemacs-fallback-fonts) ; fix unicode icon display in spacemacs mode-line By default, there are three profiles setup in cfs-profiles, (setq cfs-...


2

You can set the coding system that your terminal uses by adding the following to your init file: (set-terminal-coding-system 'utf-8) utf-8 is often what you want, but to get a list of other possible values, you can use M-x list-coding-systems.


2

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 is to look at the LC_ALL/LC_CTYPE/LANG environment variables and pick a language environment based on the values found there. That means that the default is to ...


2

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 more efficient and has at least the same level of simplicity as his solution. But maybe such a statement is subjective. (defun delete-non-displayable () "...


2

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-keymap, quail-simple-translation-keymap and quail-conversion-keymap (which are used depending on precisely which quail-based input method you use) are assigned ...


1

After upgrading request package to the latest version this is working for me. See this https://github.com/kidd/org-gcal.el/issues/41


1

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-mode-hook. So you get into an infinite loop. Thereby, "indirectly runs" means: the major mode hook org-mode-hook is run by the major mode function org-mode ...


1

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>. (Case is not relevant since case-fold-search is let-bound to t.) That function is a member of auto-coding-functions by default. So the coding system is ...


1

This issue has now been fixed in the latest git version of Emacs thanks to help from Eli Zaretskii.


1

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 () (interactive) (goto-char (point-min)) (while (re-search-forward "\\\\u[:xdigit:][:xdigit:][:xdigit:][:xdigit:]" nil t) (replace-match (string (read-from-string ...


1

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-term-use-utf8) in the ansi-term configuration of user space_voyager in his question "ansi-term changes in line-mode not registered after char-mode". These lines ...


1

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 (uint8) value of N-th byte of utf-8 encoded char CH. CH-SIZE is (utf8-char-width CH)." ;; Does not check for surrogates for simplicity. (pcase ch-size (`1 ch)...


1

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 use your OS's input method. E.g. I usually type é with Multi_key ' e rather than by using an Emacs input method. Also, often I circumvent entering non-ASCII ...


1

Sounds like you might be bumping into Emacs bug #21428: 24.5; Crash of emacs on OS X, installed via homebrew cask. It's still being investigated. If you follow the bug thread perhaps you can contribute to helping understand it.


1

M-x customize-group RET org-entities, then fill the form under Org Entities User. The name field is the one which will enable the transformation. I set name: Norm so that \Norm transforms to ‖. I couldn't get it to work for \| however.


1

FWIW I've have a collection of coding system settings, which is largely copy/paste from elsewhere (and thus I could not say with certainty that they are all required), but may be of interest: (prefer-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) ;; also see `my-frame-config' (set-keyboard-coding-system 'utf-8) ...


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