compact_enc_det是google的开源编码检测项目,开源与github:
https://github.com/google/compact_enc_det.git
compact_enc_det可以用来检测给定的文本文件的编码类型,支持多种类型的文本:
enum TextCorpusType {
WEB_CORPUS,
XML_CORPUS,
QUERY_CORPUS, // Use this for vanilla plaintext
EMAIL_CORPUS,
NUM_CORPA, // always last
};
其主要的检测编码的方法描述如下:
Encoding DetectEncoding(
const char* text, int text_length, const char* url_hint,
const char* http_charset_hint, const char* meta_charset_hint,
const int encoding_hint,
const Language language_hint, // User interface lang
const TextCorpusType corpus_type, bool ignore_7bit_mail_encodings,
int* bytes_consumed, bool* is_reliable);
在linux上将这个 项目编译成 动态链接库的步骤如下:
1. 下载代码:git clone ht

最低0.47元/天 解锁文章
814

被折叠的 条评论
为什么被折叠?



