Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make emacs display a multi-byte encoded file, properly? Is it mule?

When I open a multi-byte file, I get this:

alt text

like image 919
Cheeso Avatar asked Dec 06 '22 04:12

Cheeso


2 Answers

Short term, you can revisit the file with an alternate coding system with revert-buffer-with-coding-system (select utf-16le then).

Middle term, you can bump the priority of that utf-16le encoding on load with prefer-coding-system.

Long term, however, you'd better try to understand why emacs did not pick the right encoding. I'm not sure how I can help there though, short of digging inside the coding system guts, or at least have a file to reproduce.

EDIT: Does this file have a BOM ?

like image 115
Bahbar Avatar answered Jan 09 '23 03:01

Bahbar


If memory serves, Emacs will prompt the User for an encoding if it cannot determine one. When it makes a wrong determination you can use

C-x RET f coding RET

which will use coding as the coding system for the visited file in the current buffer.

like image 28
pajato0 Avatar answered Jan 09 '23 04:01

pajato0