- Replace error types
InvalidUtf8Array
,InvalidUtf8Slice
,InvalidUtf8FirstByte
andInvalidUtf8
withUtf8Error
plusUtf8ErrorKind
.
Which of the new error kind variants is reported don't map 1:1 to the old enum variants: For exampleUtf8ErrorKind::NonUtf8Byte
is returned for sequences that would previously have been reported as too high codepoint or overlong encoding. - Rename many other error types for consistency:
InvalidCodepoint
->CodepointError
InvalidUtf16FirstUnit
->Utf16FirstUnitError
InvalidUtf16Array
->Utf16ArrayError
InvalidUtf16Slice
->Utf16SliceError
1InvalidUtf16Tuple
->Utf16TupleError
- Change return type of
CodepointError::error_range()
toRangeInclusive
. - Rename some errors variants:
Utf16SliceError::FirstLowSurrogate
->FirstIsTrailingSurrogate
Utf16SliceError::SecondNotLowSurrogate
->SecondIsNotTrailingSurrogate
Utf16TupleError::InvalidSecond
->SecondIsNotTrailingSurrogate
- Expose the error type of
Utf16Char::from_bmp()
and rename it toNonBmpError
. - Remove re-exports of
Utf8CharIterator
andUtf16CharIterator
from the crate root.
(They are still exposed via theiterator
module.) - Remove impls of the deprecated
AsciiExt
trait, and make the methods available in#![no_std]
-mode. - Make many of the previously
AsciiExt
methods take self by value. - Drop support for pre-1.0 versions of the ascii crate.
- Remove
iter_bytes()
anditer_units()
. - Increase minimum Rust version to 1.56 and change the minimum Rust version policy.
- Fix possible UB or panic in
Utf8Char::from_slice_start_unchecked()
when passed an empty slice.
(relates to #12.) - Make many methods
const fn
. - Add
const fn
sUtf8Char::new()
andUtf16Char::new()
.
- Fix pointless undefined behavior in
Utf16Char.to_ascii_char()
(which is part of ascii feature) - Widen ascii version requirement to include 1.*.
- Add
[u16; 2]
UTF-16 array alternatives to(u16, Some(u16))
UTF-16 tuple methods. - Add
Utf16Char.is_bmp()
.
- Fix docs.rs build failure
- Fix UB in UTF-8 validation which lead to invalid codepoints being accepted in release mode.
- Add fallible decoding iterator adapters
Utf8CharMerger
andUtf16CharMerger
and slice-based iteratorsUtf8CharDecoder
andUtf16CharDecoder
- Widen ascii version requirement from 0.8.* to 0.8.0 - 0.10.*
- Implement creating / extending
String
s fromUtf16Char
-producing iterators
- Fix UTF-8 overlong check. (
from_array()
andfrom_slice()
accepted two-byte encodings of ASCII characters >= '@', which includes all letters) - Implement
FromStr
forUtf16Char
- Add
from_str_start()
toUtf8Char
andUtf16Char
- Add
Utf{8,16}Char{s,Indices}
:str
-based iterators forUtf8Char
andUtf16Char
equivalent tochar
'sChars
andCharIndices
. - Add
StrExt
with functions to create the above iterators. - Implement
FromIterator
andExtend
forVec<{u8,u16}>
with reference-producingUtf{8,16}Char
iterators too. - Add
Utf8CharSplitter
andUtf16CharSplitter
:Utf{8,16}Char
-to-u{8,16}
iterator adapters. - Add
IterExt
,iter_bytes()
anditer_units()
to create the above splitting iterators. - Add
Utf8Char::from_ascii()
,Utf16Char::from_bmp()
with_unchecked
versions of both. - Add cross-type
PartialEq
andPartialOrd
implementations. - Change the
description()
for a few error types.
- Hide
AsciiExt
deprecation warning and add replacement methods. - Correct documentation for
U8UtfExt::extra_utf8_bytes()
. - Fix misspellings in some error descriptions.
- Avoid potentially bad transmutes.
- Implement
Display
forUtf8Char
andUtf16Char
.
- Replace the "no_std" feature with opt-out "std".
- Upgrade ascii to v0.8.
- Make tests compile on stable.
- Remove
CharExt::write_utf{8,16}()
becauseencode_utf{8,16}()
has been stabilized. - Return a proper error from
U16UtfExt::utf16_needs_extra_unit()
instead ofNone
. - Rename
U16UtfExt::utf_is_leading_surrogate()
tois_utf16_leading_surrogate()
. - Rename
Utf16Char::from_slice()
tofrom_slice_start()
andCharExt::from_utf{8,16}_slice()
tofrom_utf{8,16}_slice_start()
to be consistent withUtf8Char
. - Fix a bug where
CharExt::from_slice()
would accept some trailing surrogates as standalone codepoints.
- Change
CharExt::write_utf{8,16}()
to panic instead of returningNone
if the slice is too short. - Fix bug where
CharExt::write_utf8()
andUtf8Char::to_slice()
could change bytes it shouldn't. - Rename lots of errors with search and replace:
- CodePoint -> Codepoint
- Several -> Multiple
- Update the ascii feature to use ascii v0.7.
- Support
#[no_std]
; see 70e090ee for differences. - Ungate impls of
AsciiExt
. (doesn't require ascii or nightly) - Make the tests compile (and pass) again. (They still require nightly).
First release.