Clone this repo:


  1. 8a7e1cf Merge pull request #24 from TedLyngmo/master by Jinsuk Kim · 3 months ago master
  2. 6e82eac Fetch a known-good version of googletest by Ted Lyngmo · 5 months ago
  3. 3ba4720 Merge pull request #21 from Baklap4/fix/conversion-warning by JinsukKim · 1 year ago
  4. a632e51 Fixed int to char conversion warning for object initialization by Arjan Speiard | Asgard Sings! · 1 year ago
  5. 96e566d Merge pull request #19 from Koellewe/patch-1 by JinsukKim · 1 year, 6 months ago


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,

How to build

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

$ cd compact_enc_det
$ ./
$ 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 .