如何检测一些文本的编码? [英] How do I detect the encoding of some text?

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

问题描述

如何识别一些文本编码的格式,ASCII,Unicode或UTF-8?

How can I identify which format some text is encoded in, either ASCII, Unicode or UTF-8?

推荐答案

短答案



没有保证方式来检测任意一组字节的编码。

Short answer

There is no guaranteed way to detect the encoding of an arbitrary set of bytes.

  • How can I detect the encoding/codepage of a text file
  • Java: How to determine the correct charset encoding of a stream
  • How to reliably guess the encoding between MacRoman, CP1252, Latin1, UTF-8, and ASCII
  • GuessEncoding - only works for UTF-8, UTF-16LE, UTF-16BE, and UTF-32 ☹
  • ICU Charset Detector
  • cpdetector, free java codepage detection
  • JCharDet (Java port of Mozilla charset detector) ironically, that page does not render the apostrophe in "Mozilla's" correctly

从我的答案中翻转 here

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

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