Clone this repo:


  1. 37529e6 Merge pull request #16 from Teckids/google/fix-hurd-kfreebsd-build by JinsukKim · 1 year, 9 months ago master
  2. e9e7e81 fix memrchr detection by mirabilos · 1 year, 9 months ago
  3. 1193457 Merge pull request #13 from nico/semis by JinsukKim · 2 years, 2 months ago
  4. ba412ea Fix -Wextra-semi warnings. by Nico Weber · 2 years, 2 months ago
  5. 9357fb5 Merge pull request #12 from sonicdoe/clang by JinsukKim · 2 years, 3 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 .