Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [character-encoding]

Character encoding refers to the way characters are represented as a series of bytes

7
votes
2answers
3k views

Set default coding system = UTF-8

Windows 10 (64 bit), Emacs 25.1 I want when I save any file to save them (by default) with coding system = UTF-8. So In my init.el I has : (prefer-coding-system 'utf-8) (set-default-coding-systems '...
0
votes
0answers
26 views

org-babel results with accented characters

I have a problem with the output of org-babel code blocks when this output contains accented characters. For example, if I execute this code block: #+name: test_accented #+begin_src python :results ...
0
votes
0answers
24 views

My terminal emacs displays weird characters (\u2506) for unvisiable characters in buffers

I'm currently in a new environemnt, my emacs in terminal displays weird character in files, GUI Emacs works fine. I don't know how to express this, please see the following details: Text edition: #...
0
votes
0answers
20 views

Copy or paste between terminal emacs 26 and Mac apps

I am using terminal emacs a lot, and the method from Copy text from Emacs to OS X clipboard works for a long time. But after upgrading to Emacs 26, if I kill a string like "你好" from emacs, and paste ...
5
votes
1answer
374 views

Under Windows, Emacs cannot handle encodings correctly for subprocesses, can it?

I have two simple text files on my D: drive, as shown below. D:\我.txt I D:\你.txt You After I execute M-x diff and type the correct filenames (Yes, I can input Chinese and filename ...
0
votes
1answer
20 views

Characters replaced with angled bracket sequence, possibly due to encoding

I have files in Markdown, saved in a Dropbox folder. One of them replaces characters with angled bracket sequences. For example a git diff no-index between the saved file and a copy-paste of the text ...
9
votes
1answer
986 views

Coding System utf-8 on Mac - Which one and why as default?

I want to change my default encoding system from non defined to UTF-8 (I think that would be useful). Now I have seen many different UTF-8 coding systems: mule-utf-8 mule-utf-8-dos mule-utf-8-...
1
vote
0answers
42 views

Org-mode ellipsis arrow is not using my defined encoding (utf-8)

First, some info on my system/version: Windows 10 Emacs 26.1 (I'm new to Emacs, so let me know if there is more information I should provide) This is what is happening: The image above shows that ...
2
votes
1answer
60 views

How to have a buffer interpret C-m as an actual carriage return

I'm using the following elisp snippet in a dedicated buffer to track progress of a wget download. (with-current-buffer buf (setq proc (apply 'start-process "my-download" buf (list "wget" (...
1
vote
1answer
43 views

detect unprintable glyph (aka “no font available”) programmatically

Sometimes a font or a font at a special fontsize does not support a unicode glyph. Then a placeholder (box with character number) is printed, see screenshot with selected line: How can I ...
2
votes
1answer
54 views

How to delete ^M in the diffs of Magit?

I had an issue with a file that had inconsistent line ending. My file would show a ^M for every line ending. I ran into this article that shows how to get rid of the ^M character and set the buffer ...
4
votes
2answers
219 views

Pasting Text from Clipboard - why ^M instead of linebreaks?

I'm using some VBA scripts which copy Text in MS Outlook from an e-mail message and send it to the clipboard. If I then paste the clipboard content with Ctrl-Y in Emacs 24.5.1 in Windows 7, the ...
0
votes
1answer
68 views

How open text file by default with UTF-8 endcoding system?

Emacs 26.1, Windows 10 In my init.el: (set-language-environment "UTF-8") But when I open text file the Emacs not show correct Cyrillic text. Why? describe-variable -> buffer-file-coding-system ...
1
vote
0answers
25 views

R in ESS outputs UTF-8, which emacs renders raw

I find the question but no answer at Emacs ESS R - Message Content Encoding and Display Issue. In buffer *R*, the R process uses UTF-8 encoding for its output. However emacs does not decode that ...
0
votes
1answer
48 views

Emacs not show Cyrillic text (UTF-8)

Emacs 26.1, Windows 10 I open by Notedpad++ text file. Here result: As you can see the encoded is UTF-8. And as result Notepad++ success show Cyrillic. Nice. Now I open same file by Emacs: Why ...
2
votes
2answers
81 views

Opening file with emacsclientw, file name contains non-latin characters

My first post here about Emacs. I've spent days trying to figure out answer before posting here. I'm running Emacs 26.1 on Windows 10. The setup that I'd like to have is running a single instance of ...
0
votes
1answer
106 views

Problem with character encoding in Emacs 25

I am running Emacs 25 on Ubuntu 18.04. When I type accents, they display properly, but when I close and then reopen the file they appear like a backslash and then an octal number. This only happens ...
6
votes
3answers
3k views

Emacs: How convert txt file to UTF-8 from Windows-1251?

Windows 10, Emacs 25. When I want to convert file from Windows-1251 to UTF-8 I use Notepad++. Before convert: convert: after convert: My question is: Is it possible this convert in Emacs?
1
vote
2answers
96 views

Getting no-conversion (nil) encoding each time when opening a file (which should be in utf-8)

I have a file which is encoded in utf-8. But for some reason, each time I open it in Emacs, I get no-conversion (nil) encoding, and all the non-ascii characters can't display correctly. If I run ...
2
votes
0answers
36 views

fix buffer invalid UTF-8 encoding characters by query/replace

When I copy text from web pages, there are some special characters like ', - etc (not UTF-8 encoding). As you can see in the following screenshot: I checked out some similar questions in this site: [...
1
vote
0answers
61 views

Wrong unicode glyphs in emacs?

I recently came across a python file "*.py" containing several prints consisting of unicode symbols. I noticed that several symbols are displayed with different glyphs in emacs than in another editor. ...
4
votes
1answer
344 views

Encoding issue for French text

My problem: With my Emacs 26.1 on my 10.13.6 Mac, I have a opened a third-party text file, and it turns out I have the wrong encoding set : the text is in French , and the accentuated characters are ...
2
votes
2answers
638 views

How to set default encoding to utf-8, and default line ending to linux style?

I use this piece of code to set the default line ending to linux-style \n ;; https://www.emacswiki.org/emacs/EndOfLineTips (add-hook 'find-file-hook 'find-file-check-line-endings) (defun dos-file-...
0
votes
0answers
30 views

Russian file names problem on linux-mint

On my system, there are files and folders with russian file names. However, in dired buffers and filename complations they are garbled (as mojitake). The problem is compounded by the fact that even ...
2
votes
2answers
94 views

Greek typing & spell-checking with hunspell: encoding issue?

hunspell-checking Greek text I create in Emacs is not working. Notes: I am aware of this post: Spell check with multiple dictionaries Eventually, I want to use ispell with hunspell in Emacs, which ...
5
votes
2answers
1k views

Emacs doesn't let me exit without selecting a coding system

Sometimes to speed up of opening an emacs' eshell directly from terminal (in my case from MS DOS prompt), I do emacs -Q -f eshell. But when I try to exit emacs doesn't let it, unless I give some input ...
1
vote
0answers
103 views

copying into emacs from clipboard garbled

When I copy data from outside to my emacs, it is garbled (venv) tree ./scripts scripts ├── foo.sh ├── bar.sh ├── start.sh ├── stop.py However, when I paste this in emacs, I get this: (venv) tree ....
0
votes
2answers
71 views

Org links file name encoding issue

Inspired by John Kitchin's presentation of org-links features in Org-mode 9, I tried to implement a simple functionality for "file" links. Since I am working on several machines, I wanted the link ...
4
votes
2answers
147 views

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

I mean these: I'd like to remove them, so I'm looking for a function which can find all these characters in the buffer which cannot be displayed properly with the current font and therefore show up ...
1
vote
0answers
48 views

Emacs ESS R - Message Content Encoding and Display Issue

I use Emacs ESS for doing some work in R. But somehow the help messages or content which is output of R process, is not printed correctly, most likely because of some encoding issue. (Screenshot ...
1
vote
1answer
77 views

Display glyphs instead of codepoints

I have a JSON file where Unicode characters are encoded as UTF-8 codepoints, example: \u05de instead of the Hebrew character Mem (מ). How could I get emacs to display glyphs instead of the codepoint ...
1
vote
1answer
107 views

Strange encodings in ORG mode with German umlaute

I have a few org files encoded in UTF-8. Everything works fine, also with German umlaute (ä, ö, ü, ß). These files I sync with Git between different PCs (mostly running Debian). When I synced one of ...
1
vote
2answers
187 views

How can I view accent characters natively?

In GUI emacs 25.3.1, I have a text file with octal character codes for accents. For example I have many \212 characters which are really Š characters. If I replace-string the occurrences, it shows ...
2
votes
1answer
173 views

Quail Rules UTF8 behaviour

I had inserted the following code in .emacs: (quail-define-package "LaTeX-UTF-8" "TeX" "TeX") (quail-defrule "α" ["\\alpha"]) what I want to do is the following: when I insert the character "α" (I ...
0
votes
0answers
54 views

Painfully slow encoding popup with “temp file” when creating new file

Around half the time (and I haven't established a solid repro that triggers it), opening a new file in emacs will trigger a big pause, then two windows appear: one showing *temp file* and one asking ...
1
vote
1answer
85 views

Org tangle source blocks to a file with byte-order-mark (BOM) from org mode

Because Firefox doesn't load local files with UTF8 characters like '📞, …, 🖥' in the HTML or the CSS correctly, since it does not receive a <meta charset="utf8" /> header, I need to tangle ...
4
votes
0answers
146 views

Shell coding system

If, before M-x shell, I run C-x RET c (universal-coding-system-argument) I can change the coding system used by the shell. Therefore, given echo Straße > foo foo will be encoded in the related ...
11
votes
3answers
5k views

How to display Unicode UTF-8 as Unicode?

I have some UTF-8-encoded text files which display strange escape codes in Emacs. For instance, this text: In ista quaestione primo exponam quid intelligendum est per hoc nomen ‘Deus’; secundo, ...
0
votes
1answer
68 views

File encoding differet when visiting the file again

I have this in my .emacs: (setq-default buffer-file-coding-system 'utf-8-unix) When I create a file in emacs and save it, it should be buffered and saved in utf-8-unix. When I open such a file ...
1
vote
1answer
87 views

Replace certain multibyte characters

In my markdown file (coming from a Windows computer on which I have no control), I have several multi-byte characters. Some text xx Some text yy Some text In emacs, they are displayed as \221 and \...
3
votes
2answers
612 views

How encode to UTF-8 content of buffer?

Windows 10, Emacs 25.1 When I open file that not encoding in UTF-8 I get the next incorrect result: I try by command set-buffe-file-coding-system but it not help. And here result: As you can see ...
0
votes
2answers
407 views

File names encoding when running shell-command on Windows XP

I faced a problem when pdflatex launched from Emacs couldn't compile files whose name contained Russian characters. The same code worked on Linux, so I suspected that something is wrong with encoding ...
1
vote
1answer
65 views

Display devanagari characters

Running Emacs 25 on Kubuntu 17.10. I am able to enter text in devanagari script but it does not dispaly correctly in the editor. For instance, the text entered as: क का कि की कु कू के कै को कौ कं कः...
6
votes
1answer
828 views

How can I save UTF-8 files with a Byte Order Mark?

I am trying to configure Emacs to save UTF-8 files with a Byte Order Mark. (Yes, I know that the BOM is evil and unnecessary for UTF-8 files. However, Microsoft has decided they know better, so I want ...
2
votes
3answers
978 views

How to get rid of BOM (byte order mark)

How can I open a file with a BOM Byte Order Mark and ensure that BOM is gone when I save the file.
3
votes
1answer
80 views

Encoding in buffers not associated with files

I use Magit to manage Git repositories. Some of these repositories have collaborators whose names contain accented characters. In a freshly-started Emacs, everything looks fine. In a long-running ...
3
votes
1answer
194 views

How to query/set the character encoding?

How can I find out what character encoding Emacs employs in saving a text file to disk? And how can I specify this encoding? Operating system: macOS Sierra, Version 10.12.5 Emacs: GNU Emacs 25.1.1
1
vote
0answers
89 views

Wrong encoding in eshell when closing Emacs

I have a lot of filenames in Russian in my file system. Every time I close Emacs if I had eshell opened, it shows a *temp* buffer with a list of directories. And asks 2 questions: Select coding ...
0
votes
1answer
356 views

UnicodeEncodeError executing python in Emacs - not in Terminal

I have a python file which defines a function and calls it. def remove_whitespace(input_file, output_file): with open(input_file) as f: f.readlines() # do something If I execute ...
0
votes
2answers
406 views

emacs counts German umlaut as two columns

I have been writing a document with a not monospaced font, because it is not code but only text. This is a document written in reStructuredText, with the file ending .rst and when it is opened in ...