Questions tagged [character-encoding]

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

3
votes
0answers
153 views

Emacs keeps guessing wrong coding system on a file I edit both in Linux and Windows

I use Emacs on both Linux and Windows to edit the same files (that I keep in Dropbox, which I hope is irrelevant, but who knows). The files are encoded in utf-8 with Unix line endings. Occasionally, I ...
5
votes
0answers
2k views

Emacs IPython prompt symbol is garbled

I just installed Fedora 24 with Emacs and IPython. When I launched the IPython shell in Emacs, the prompt symbol, which should be "In [1]", is displayed as "^[[?12l^[[?25h". Is there a way to solve ...
0
votes
1answer
454 views

UnicodeEncodeError in inferior python under windows

I have recently started using emacs under Windows as my python IDE. I had some struggle getting python convinced that it was allowed to output UTF-8 to my terminal emulator (mintty does support ...
0
votes
2answers
449 views

Can serial-term interpret new line characters as CR LF?

I'd like to read a serial link from Emacs using serial-term. The output looks wrong, like if the new line characters did not trigger carriage return: First line Second line ...
3
votes
2answers
227 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 ...
5
votes
2answers
504 views

Org-mode timestamps encoding

I love org-mode. It's main reason why i switched from vim. It's really interesting to write reports using Literate Programming. I try to use TODO, agenda etc. to be more productive. I was able to ...
3
votes
1answer
180 views

How can I always open a file with a certain coding system?

I'm trying to open the edict2.gz file from http://www.edrdg.org/jmdict/edict_doc.html which is a japanese->english dictionary so first I changed the extension to .txt. Currently there are many ...
6
votes
1answer
859 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 ...
1
vote
1answer
67 views

How to fix latin character (e.g. ç, é) incorrectly displayed in emacs ess-buffer?

When I read a file into R, and the file contain characters like "ç" or "é" (latin characters) in a string, the ess-buffer shows meaninless (to me) numbers. For example, the string "ações" is ...
1
vote
2answers
98 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 ...
4
votes
0answers
584 views

How do I change permanently the encoding of a text file?

I have a bunch of html files encoded as iso-8859-1-unix and a few encoded in utf-8-unix. What I want is to encode all of them in utf-8-unix. I have already tried (I think they are the same command, ...
5
votes
1answer
234 views

Check if terminal supports Unicode

I would like to use special mark symbols not only in window-system but also in xterm: (setq gnus-summary-to-prefix (if window-system "▒ " "==> ")) What check I should use?
6
votes
1answer
1k views

Emacs is asking me for a coding system on each save

I consolidated many text files (win, mac, unix) into a single orgmode file. For some characters I was seeing numbers instead of the right characters. Things like \314\203. I used "revert-buffer-with-...
1
vote
1answer
74 views

Emacs doesn't show cyryllic properly over SSH

I'm using SSH to connect to remote server. On the server, I'm running emacs (emacsclient -c). It servers as my console, text editor and WM. While everything works nice when I'm not dealing with ...
0
votes
1answer
373 views

Why are some Chinese characters not displayed using the specified font?

I specified the font using: (set-face-attribute 'default nil :font "Inziu Iosevka SC") The expected result is (in notepad.exe): But the result in Emacs is actually: Only 举, 头 and 乡 are displayed ...
3
votes
1answer
1k views

Open Russian file names on windows?

In emacs on Windows 8.1 I can't open a file if its full name contains Russian letters [and generally any non-ascii char]. For example, if I try to open D:\ББББ\test.txt I get: I find a config which ...
4
votes
1answer
154 views

Invalid coding system: auto-save-coding when trying to recover auto-save files

Sometimes when I try to run recover-this-file I get an error Invalid coding system: auto-save-coding which prevents the file from being recovered. I had to manually find the autosave file and copy ...
1
vote
1answer
1k views

How to convert a MULE encoded file to UTF-8?

I am trying to modify a buffer written by desktop-save to a file. The file is named .emacs.desktop and I am trying to modify it from a Perl script. It turns out that it is saved in emacs-mule encoding....
9
votes
1answer
989 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
206 views

Hunspell: encoding of personal dictionary

I am using hunspell 1.3.2 (on Windows) for spell checking, and I've been trying to make a personal dictionary. It works just fine, except the encoding is garbled. Whether I encode the personal ...
1
vote
0answers
163 views

Why does emacs insert a `#coding` header into my file?

I have a file where every time I save the file emacs inserts a # coding: utf-8 at the top of the file. I'm using the prelude package. How do I turn this off? I'm having a hard time tracing where this ...
6
votes
1answer
205 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 ...
1
vote
2answers
661 views

How to convert Unicode backslash octal representation to the character it represents?

If I paste a string from some web page into an Emacs buffer sometimes it will show the Unicode representation of some characters with a backslash and some octal code. How can I convert this to the ...
1
vote
0answers
721 views

How do I edit text in Cyrillic / Russian on OpenBSD?

I'm trying to make it possible to easily edit text in Cyrillic / Russian on a remote OpenBSD 5.2 amd64. I'm using emacs-21.4p18-no_x11, which doesn't show any Cyrillic characters whatsoever when I ...
6
votes
2answers
2k views

How to insert invalid UTF-8 sequence

In order to test that some code handles an invalid UTF-8 sequence properly, I need to insert an invalid UTF-8 sequence into an existing text file. However, my attempts to do so result in a valid UTF-...
2
votes
1answer
193 views

Unicode and `url-unhex-string` and something like \345\205\266\344\273\226

I need to use Emacs built-in url.el url-unhex-string to decode uri (e.g. /%E5%85%B6%E4%BB%96/other) It works, but all non-ascii (I guess it should be Unicode) characters are all converted into ...
11
votes
3answers
6k 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, ...
2
votes
1answer
113 views

How to get UTF-8 displayed properly in Emacs menus?

I use GNU Emacs 23.4.1 that comes with Debian Wheezy and UTF-8 as system character encoding. When I add bookmark it displays properly in minibuffer and in the buffer, however the bookmark name is ...
4
votes
1answer
490 views

How to set the coding system for new files with specific extensions

When I visit a new file, ^xf, that has an extension of .sql or .dsql I would like the coding system to be set to utf-8-with-signature-dos. The default is currently iso-latin-1-dos. I'm running (...
9
votes
3answers
1k views

Package manager encoding error

Upon running package-list-packages, I get the following error. These default coding systems were tried to encode text in the buffer ` *temp*': (iso-latin-1-dos (3242 . 37326) (3243 . 40165)) ...
8
votes
2answers
1k views

Using UTF8 encoding as default when writing emails

When I want to send an email I composed in Emacs, I press C-c C-c and am always presented with such an error message: These default coding systems were tried to encode text in the buffer `2015-02-...
0
votes
1answer
84 views

How to run iso-tex2iso in batch mode?

Main question: In order spell checkers can apply, M-x iso-tex2iso is nice for converting TeX-encoded files to e.g. UTF-8 encoded ones. But, in case a numerous files to convert, running this command in ...
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 ...
2
votes
0answers
107 views

What coding system should I use for one Emacs configurations for both unix and Windows?

I set the coding as utf-8, and I got many ^M from eshell on Windows. There's utf-8-dos and utf-8-unix. I would like to use the same configuration file on both unix and Windows. I guess there are many ...
5
votes
2answers
2k views

How to strip invalid UTF-8 characters from a string?

TL;DR: I have a string with characters that are unencodable in UTF-8, and I need to remove these characters before writing the string to a file. For instance, the following snippet creates a file ...
9
votes
1answer
525 views

How to get human language-specific numerals?

TL;DR: how can I use Hindi digits (١٢٣...) when writing in Arabic? Emacs is arguably hailed as the best editor, but when it comes to using numerals in the context of writing there are no satisfactory ...
3
votes
1answer
751 views

Unicode characters with same font produce different results in GUI and terminal

While I'm able to display the cute little snowman ☃ in both GUI and terminal I'm not able to display these unicode characters in the terminal although it works in the GUI : Ⓐ Ⓑ ... I've got the usual ...
14
votes
4answers
6k views

How to input special character, such as Celsius symbol, and common greek letters?

I want to input: Celsius degree symbol Common Greek letter: Alpha, Theta, Omega
8
votes
2answers
543 views

How to change octal sequences into utf-8 text

When I copy non-ascii text from Windows and paste into Emacs, it shows up as an octal sequence. For example, if I paste ä into Emacs it shows up as \344. I could type C-q 344 to get the ä back in ...
6
votes
1answer
300 views

Why must I set and reset `buffer-multibyte` to correctly view multibyte buffers?

In an ongoing project, we are inserting multibyte text into a buffer and experiencing strange behavior. When the question is first viewed, we receive something like: Quote Environment à la Strunk\...
5
votes
1answer
480 views

UnicodeDecodeError in my Inferior Python buffer

While trying to run a python script in an Inferior Python buffer for Python 3.3.5 in my Emacs 24.3.1 GTK+ window, I get a >>> Traceback (most recent call last): File "<stdin>", line ...
2
votes
1answer
404 views

How to transfer special characters like äöü in the command line to emacsclient?

I try to create an interaction between Emacs and other applications, e. g. Microsoft Office. For example I have defined a VBA Macro in MS Outlook which starts a search in Emacs: strEmacsclientPath = ...
2
votes
1answer
710 views

What does `mac` in `utf8-mac` mean?

In Emacs, I show the newline convention used by emacs for the current file, by M-x describe-variable, then buffer-file-coding-system. The result is utf8-mac. Does mac, dos, unix after the hyphen ...
4
votes
2answers
256 views

Advice on setting shell's character set

M-x shell has been my friend for decades, and I've always been comfortable even sympathetic with his insistence on being a dumb terminal (i.e. TERM=dumb). But recently I've found my self setting ...
7
votes
3answers
1k views

単 does not show up in Emacs, how to fix?

I'm editing a text file containing Japanese kanji characters. 単 does not show up in Emacs, how to fix? It shows up as some sort of white space. Update: I'm using GNU Emacs 24.3 (9) for Mac. After ...
5
votes
1answer
342 views

Handling text files with mixed encodings

I created a text file by copying its different parts from different sources (webpages, other text files, pdf files) into gedit and saved it to the file. I wonder if that is the reason why I may have ...
5
votes
1answer
906 views

Character encoding when copying some text from somewhere to Emacs and saving to a file

Suppose I copy some text from a source (e.g. a webpage, a text file opened in an editor such as gedit or emacs) to a buffer in emacs, and then save the buffer to a text file. When I copy the text ...