Clone this repo:

Branches

  1. d127078 Merge pull request #28 from cloudaper/add-3rd-party-to-readme by Jinsuk Kim · 8 months ago master
  2. dcab2ba Add 3rd party bindings to README by Kryštof Korb · 8 months ago
  3. 9f8e8f5 Merge pull request #27 from cloudaper/change-shebang by Jinsuk Kim · 8 months ago
  4. 7a628c0 Change shebang to sh instead of bash by Kryštof Korb · 8 months ago
  5. 8a7e1cf Merge pull request #24 from TedLyngmo/master by Jinsuk Kim · 1 year, 7 months ago

Introduction

Compact Encoding Detection(CED for short) is a library written in C++ that scans given raw bytes and detect the most likely text encoding.

Basic usage:

#include "compact_enc_det/compact_enc_det.h"

const char* text = "Input text";
bool is_reliable;
int bytes_consumed;

Encoding encoding = CompactEncDet::DetectEncoding(
        text, strlen(text),
        nullptr, nullptr, nullptr,
        UNKNOWN_ENCODING,
        UNKNOWN_LANGUAGE,
        CompactEncDet::WEB_CORPUS,
        false,
        &bytes_consumed,
        &is_reliable);

How to build

You need CMake to build the package. After unzipping the source code , run autogen.sh to build everything automatically. The script also downloads Google Test framework needed to build the unittest.

$ cd compact_enc_det
$ ./autogen.sh
...
$ bin/ced_unittest

On Windows, run cmake . to download the test framework, and generate project files for Visual Studio.

D:\packages\compact_enc_det> cmake .

3rd party bindings for other languages

Have you created bindings for another language? Open a PR and add it to the list!