Crates.io | uchardet |
lib.rs | uchardet |
version | 2.0.4 |
source | src |
created_at | 2014-11-20 20:51:53.02395 |
updated_at | 2017-12-07 20:46:48.090556 |
description | Detect character encodings using uchardet library |
homepage | https://github.com/emk/rust-uchardet |
repository | https://github.com/emk/rust-uchardet |
max_upload_size | |
id | 148 |
size | 12,410 |
Deprecated in favor of chardet, which is pure Rust. If you have use-case for this code, please feel free to open an issue. Simple PRs will still be read, and possibly accepted.
Attempts to detect the character encoding of raw text using the uchardet
library.
Example:
// At the top of the file.
extern crate uchardet;
use uchardet::detect_encoding_name;
// Inside a function.
assert_eq!("UTF-8",
detect_encoding_name(""©français"".as_bytes()).unwrap());
If you also would also like to detect the language used in the decoded text, see rust-cld2.
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 should work if you have an appropriate
g++
(or MSVC) compiler installed, as well as cmake
. We test this build
on Linux, OS X and Windows (both MinGW and MSVC) using Travis CI.
As always, pull requests are welcome! Please keep any patches as simple as possible and include unit tests; that makes it much easier for me to merge them.
If you want to get the C/C++ code building on another platform, please see
uchardef-sys/build.rb
and this build script guide.
You'll probably need to adjust some compiler options. Please don't
hesitate to ask questions; I'd love for this library to support more
platforms.
In your first commit message, please include the following statement:
I dedicate any and all copyright interest in my contributions to this project to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
This allows us to keep the library legally unencumbered, and free for everyone to use.
Contributors include:
uchardet
libraries
and Microsoft Windows, plus the error-chain conversion.Thank you very much for your contributions!
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:
uchardet
C++ library include in uchardet-sys/uchardet
via
a git submodule is distributed under the Mozilla Public License 1.1.