如何确定文本文件的编码表 [英] How to determine encoding table of a text file

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

问题描述

我有.txt和.java文件,我不知道如何确定文件的编码表(Unicode,UTF-8,ISO-8525 ...)是否存在一些程序来确定文件编码或请参阅编码。

I have .txt and .java files and I don't know how to determine encoding table of the file (Unicode, UTF-8, ISO-8525...) Is it existing some program to determine file encoding or to see the encoding.

推荐答案

如果您使用Linux,请尝试 file -i filename.txt

If you're on Linux, try file -i filename.txt.

$ file -i vol34.tex 
vol34.tex: text/x-tex; charset=us-ascii

为了参考,这里是我的环境:

For reference, here is my environment:

$ which file
/usr/bin/file
$ file --version
file-5.09
magic file from /etc/magic:/usr/share/misc/magic

某些 file 版本(例如OS / X上的文件5.04)有稍微不同的命令行开关:

Some file versions (e.g. file-5.04 on OS/X) have slightly different command-line switches:

$ file -I vol34.tex 
vol34.tex: text/x-tex; charset=us-ascii
$ file --mime vol34.tex
vol34.tex: text/x-tex; charset=us-ascii

另外,看看此处

这篇关于如何确定文本文件的编码表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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