识别emacs中的编码 [英] recognising encodings in emacs

查看:134
本文介绍了识别emacs中的编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的理解,txt文件没有存储编码信息,所以文本编辑器只是对某个给定的文本文件的编码进行了有根据的猜测,然后使用这个猜测的编码在屏幕上显示文件。如果编辑猜到了,你可以在屏幕上显示你的文字,如果编辑猜错了,那么你(有时候)会有乱七八糟的。我现在得到这个权利吗?



现在我的问题。我有一个csv文件中的银行对帐单。当我在MS Excel 14(MS Office 2010)中打开它时,它识别编码并将有问题的工作显示为obračun。大。当我在Emacs 24.3.1中打开文件时,它无法识别正确的编码,并将有问题的单词显示为obra銮n。我的问题是:如何告诉Emacs该文件的编码方式?



谢谢。

解决方案

Emacs手册


如果Emacs识别编码的文件不正确,您可以使用正确的编码系统使用 Cx RET r
还原缓冲区与编码系统)重新读取
文件
)。此命令提示
编码系统使用。


utf-16 a try。


It is my understanding that txt files do not have encoding information stored so text editors simply make educated guesses about encoding of a given text file and then display the file on screen using that guessed encoding. If the editor guessed right you get your text on the screen, if the editor guessed wrong, then you (sometimes) get gibberish. Am I getting this right so far?

Now on to my problem. I have my bank statements in a csv file. When I open it in MS Excel 14 (MS Office 2010), it recognises the encoding and displays the problematic work as "obračun". Great. When I open the file in Emacs 24.3.1, it fails to recognise the correct encoding and displays the problematic word as "obra鑾n". Not so great.

My question is: how do I tell Emacs which encoding the file is in?

Thanks.

解决方案

From the Emacs Manual:

If Emacs recognizes the encoding of a file incorrectly, you can reread the file using the correct coding system with C-x RET r (revert-buffer-with-coding-system). This command prompts for the coding system to use.

Give utf-16 a try.

这篇关于识别emacs中的编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆