在 Windows 中获取文件的编码 [英] Get encoding of a file in Windows

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

问题描述

这不是真正的编程问题,是否有命令行或 Windows 工具 (Windows 7) 来获取文本文件的当前编码?当然我可以编写一个小 C# 应用程序,但我想知道是否已经内置了一些东西?

This isn't really a programming question, is there a command line or Windows tool (Windows 7) to get the current encoding of a text file? Sure I can write a little C# app but I wanted to know if there is something already built in?

推荐答案

使用 Windows 附带的普通旧版记事本打开您的文件.
当您单击另存为..."时,它会向您显示文件的编码.
它看起来像这样:

Open up your file using regular old vanilla Notepad that comes with Windows.
It will show you the encoding of the file when you click "Save As...".
It'll look like this:

无论默认选择的编码是什么,这就是您当前的文件编码.
如果是UTF-8,您可以将其更改为ANSI,然后单击保存更改编码(反之亦然).

Whatever the default-selected encoding is, that is what your current encoding is for the file.
If it is UTF-8, you can change it to ANSI and click save to change the encoding (or visa-versa).

我意识到有许多不同类型的编码,但是当我被告知我们的导出文件是 UTF-8 并且它们需要 ANSI 时,这就是我所需要的.这是一次性导出,所以记事本适合我.

I realize there are many different types of encoding, but this was all I needed when I was informed our export files were in UTF-8 and they required ANSI. It was a onetime export, so Notepad fit the bill for me.

仅供参考:根据我的理解,我认为Unicode"(在记事本中列出)是 UTF-16 的用词不当.
有关记事本Unicode"选项的更多信息:Windows 7 - UTF-8 和独角兽

FYI: From my understanding I think "Unicode" (as listed in Notepad) is a misnomer for UTF-16.
More here on Notepad's "Unicode" option: Windows 7 - UTF-8 and Unicdoe

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

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