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.
MaybeUtf8 0.2.3
Byte container optionally encoded as UTF-8. It is intended as a byte sequence type with uncertain character encoding, while the caller might be able to determine the actual encoding.
For example, ZIP file format
originally didn't support UTF-8 file names,
assuming the archive would be extracted only in the system
with the same system encoding as the original system.
The newer ZIP standard supports explicitly UTF-8-encoded file names though.
In this case, the ZIP library may want to return either a String
or Vec<u8>
depending on the UTF-8 flag.
This crate supports two types,
MaybeUtf8Buf
(analogous to String
) and MaybeUtf8Slice
(analogous to &str
).
Both types support various conversion methods.
For example, if you know that the bytes are encoded in ISO 8859-2,
Encoding can be used to convert them:
use IntoCow;
use ;
use ISO_8859_2;
use ;
let namebuf = from_bytes;
assert_eq!;
// borrowed slice equally works
// consuming an optionally-UTF-8-encoded buffer also works
assert_eq!;
IntoMaybeUtf8
trait can be used to uniformly accept either string or vector
to construct MaybeUtf8*
values.
use IntoMaybeUtf8;
assert_eq!;
Complete Documentation is available.
MaybeUtf8 is written by Kang Seonghoon and licensed under the MIT/X11 license.