An easy-to-use string encoding library, providing an interface similar to str/String, for
working with strings in encodings beyond UTF-8. Due to the API being based on std, working with other
encodings is as transparent and painless as possible.
The name, enrede, is a double wordplay - Encode/Recode/Decode, and Enrede means
'tangled' or 'caught' in Spanish.
Str<E>andString<E>types, equivalent tostrandstd::string::String, but generic over encoding.CStr<E>andCString<E>types, equivalent tostd::ffi::CStrandstd::ffi::CString, but generic over encoding.EncStrandEncStringtypes, supporting encoding dynamically chosen at runtime.Encodingtrait with support for lower-level direct encoding/recoding into slicesno_stdsupportrand::Distributionimpls for encodings, allowing easy generation of valid characters for an encoding
These features are not yet supported, but are planned for a future version:
- Extended methods for encodings following certain properties:
- Constant length encodings
- More encodings
- Big5
- More methods on strings and C-strings
By default, the std and alloc features are enabled. By using default-features = false
in your Cargo.toml, you can disable these features. When std is disabled, this crate
is no_std. When the alloc feature is disabled, the crate won't use alloc, and any types
or functions requiring allocation will be disabled (For example [String<E>]).
Since most encodings are also feature-gated, if disabling default features be sure to also enable the encodings
you want. To get all of them, use the all_encodings feature.
Currently, it is assumed that all supported encodings are subsets of the Unicode character set.