Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

Ruby bindings for [Google's Compact Encoding Detection](https://github.com/google/compact_enc_det) (CED for short) C++ library

> [!NOTE]
> Bindings temporarily use a [fork of the C++ library](https://github.com/cloudaper/compact_enc_det_fork/commit/e4eda3204bab019564b96c522baae93ee2fffdc8), which fixes the minimum CMake version for the build to pass on modern environments.

## Usage

You will need [CMake](https://cmake.org) to build the C++ native extension.
You will need [curl](https://curl.se) and [CMake](https://cmake.org) to build the C++ native extension.

>  macOS
>
Expand All @@ -27,8 +30,7 @@ Then you can install the gem from [RubyGems.org](https://rubygems.org/gems/compa
> gem install compact_enc_det
> ```

Now you can detect the encoding via the `CompactEncDet.detect_encoding`,
which is a thin wrapper around `CompactEncDet::DetectEncoding` and `MimeEncodingName` functions from the C++ library.
Now you can detect the encoding via the `CompactEncDet.detect_encoding`, which is a thin wrapper around `CompactEncDet::DetectEncoding` and `MimeEncodingName` functions from the C++ library.

> ```ruby
> file = File.read("unknown-encoding.txt", mode: "rb")
Expand Down Expand Up @@ -75,5 +77,4 @@ Tests located at `tests` use the [minitest](https://github.com/minitest/minitest

## License

This gem is released under [MIT license](LICENSE), while the original Google's [Compact Encoding Detection library](https://github.com/google/compact_enc_det) source code,
located at `ext/compact_enc_det/compact_enc_det`, is under the [Apache-2.0](LICENSE-APACHE) license.
This gem is released under [MIT license](LICENSE), while the original Google's [Compact Encoding Detection library](https://github.com/google/compact_enc_det) source code, located at `ext/compact_enc_det/compact_enc_det`, is under the [Apache-2.0](LICENSE-APACHE) license.