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

0
votes
1answer
15 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
979 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-...
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 '...
1
vote
0answers
34 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
58 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
37 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
49 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
206 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
63 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
22 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
40 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
67 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
91 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 ...
5
votes
1answer
363 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 ...
5
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
93 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
33 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
59 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
342 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
600 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
82 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
99 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
68 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
135 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
42 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
98 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
172 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
172 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
82 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
137 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
63 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
82 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
584 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
395 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
64 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
811 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
949 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
77 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
187 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
88 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
336 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
391 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 ...
1
vote
0answers
225 views

Charset and fonts shown by `describe-char`

I have some questions about emacs internal actions related to charset and fonts shown by describe-char. Now I use utf-8 as character encording scheme (CES) on emacs, so charsets shown by describe-...
5
votes
2answers
166 views

How many bytes are in the region?

After far too many years of counting the number of characters in the region by doing M-: (- (point) (mark)), I just discovered M-= (count-words-region). Much better! But now I'm looking for a way to ...
6
votes
1answer
194 views

How do I find out which input modes include a specified uft-8 character?

Using the input mode latin-1-prefix I can enter "~a" which gives me "ã". I am looking for a similar way to enter the characters "āēīōū" (vocals with bars). So my question is: What input mode does ...