uchardet 0.0.6

Detect character encodings using uchardet library
docs.rs failed to build uchardet-0.0.6
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: uchardet-2.0.4

Build Status

Attempts to detect the character encoding of raw text using the uchardet library.

To add it to your project, add the following lines to your Cargo.toml file:

[dependencies.uchardet]
git = "git://github.com/emk/rust-uchardet"

To run it:

// At the top of the file.
extern crate uchardet;
use uchardet::EncodingDetector;

// Inside a function.
assert_eq!(Some("UTF-8".to_string()),
           detect_encoding_name("français".as_bytes()).unwrap());

API documentation is available.

Are you looking for a Rust wrapper for cld2 for detecting languages? I'm currently working on one and hope to publish it shortly.

Getting uchardet (usually optional)

If you wish, you may install uchardet using your system package manager. For example, under Ubuntu, you can run:

sudo apt-get install libuchardet-dev

If you skip this step, Cargo will attempt to compile uchardet from the bundled source code instead. This will probably only work on Linux machines with CMake involved, but pull requests to improve this are welcomed eagerly.

License

New code in the rust-uchardet library is released into the public domain, as described in the UNLICENSE file. However, several pre-existing pieces have their own licenses:

  • The uchardet C++ library in uchardet-sys/uchardet is distributed under the Mozilla Public License 1.1.
  • The file uchardet-sys/src/build.rs contains several short snippets of code based on Alex Crichton's git2-rs library, which is described as being licenses "under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses." However, this file is only run at build time, not linked into the resulting executable.