如何在Windows环境中检查.txt文件是否为ASCII或UTF-8格式? [英] How to check if a .txt file is in ASCII or UTF-8 format in Windows environment?

查看:324
本文介绍了如何在Windows环境中检查.txt文件是否为ASCII或UTF-8格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用UltraEdit将.txt文件从ASCII转换为UTF-8。但是,我不确定如何在Windows环境中验证它是否为UTF-8格式。

I have converted a .txt file from ASCII to UTF-8 using UltraEdit. However, I am not sure how to verify if it is in UTF-8 format in Windows environment.

谢谢!

推荐答案

Windows中的文本文件不有格式。有一个非正式的约定,如果文件以 BOM代码点以UTF-8格式它是UTF-8,但未普遍支持该约定。那将是3个字节的序列 \xef\xbf\xbe ,即￾ Latin-1字符集。

Text files in Windows don't have a format. There's an unofficial convention that if the file starts with the BOM codepoint in UTF-8 format that it's UTF-8, but that convention isn't universally supported. That would be the 3 byte sequence "\xef\xbf\xbe", i.e. ￾ in the Latin-1 character set.

这篇关于如何在Windows环境中检查.txt文件是否为ASCII或UTF-8格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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