help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions on charset encoding detection and keyboard layout


From: Eli Zaretskii
Subject: Re: Questions on charset encoding detection and keyboard layout
Date: Fri, 11 Dec 2009 10:42:36 +0200

> Date: Fri, 11 Dec 2009 13:42:39 +0800
> From: "Hou, Ruoyu" <phoenixhou@gmail.com>
> 
> I tried the tip you gave me, but now I've got my GBK-encoded files 
> unreadable. How you would solve the problem?
> 
> Moreover, as I mentioned in the previous post, how could I set a 
> prefer-coding-system without beforehand knowledge about the encoding I 
> am supposed to encounter?

If you have many documents in different encodings that Emacs cannot
distinguish by itself, then I'm afraid there's no good solution except
"C-x RET c", which requires that you know the encoding in advance.  At
least I'm not aware of any better way.  What do other applications do?

Of course, if you inadvertently visit a file without knowing the
encoding, and want to re-visit it with the correct encoding, after you
notice that Emacs didn't properly decode it, then typing "C-x RET c
CORRECT-ENCODING RET M-x revert-buffer RET" will fix the problem.
Here CORRECT-ENCODING is the correct encoding of the file.

Also, if you could somehow manage to have documents in different
encodings to reside in different directories, then perhaps you could
set up the directory-local variables to cause Emacs decode the files
in each directory correctly.  See the node "Directory Variables" in
the Emacs user manual for details about this feature.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]