NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #819 most downloaded on crates.io
A wide string Rust library for converting to and from wide strings, such as those often used in Windows API or other FFI libaries. Both `u16` and `u32` string types are provided, including support for UTF-16 and UTF-32, malformed encoding, C-style strings, etc.
Last release 12 months ago
09 Oct 2025
Release timing varies
gaps range from 1 weeks to 1.8 years
Some releases are documented
notes for 9 of 16 stable releases
1 version withdrawn
withdrawn after publishing
11 years old
18 releases · first in 2016
Git repository URL has changed due to GitHub user name change. Old URL is redirected.
trim_end character boundary panic when processing 4-byte characters. By @syrflover.U16String::insert_char which always panicked. Fixes #46.WideCString type alias.unused_import lint on wide* macros.Utf32String and Utf32Str. You can load them from gdb/widestring.py.Minor restructing of included license file locations to be more consistent with crates ecosystem.
windows-sys for documentation tests instead of legacy winapi crate. Fixes #40.Utf16String::truncate when new_len greater than string length. Fixes #39.core library structures.One column per quarter.
Utf32String::into_char_vec and missing conversion to Vec<char> for Utf32String . Fixes #37 .
Utf32String::into_char_vec and missing conversion to Vec<char> for Utf32String. Fixes #37.include_utf16str! macro to include UTF-16 file at compile-time as Utf16Str. By @daxpedda.U16String::pop_char panics with surrogate string. Fixes #38.Correctly check for and error on nul values in C-string macros u16cstr! , u32cstr! , and widecstr! . Fixes #28 .
u16cstr!, u32cstr!, and widecstr!. Fixes #28.Reduce collision potential for macros. By @OpenByteDev .
Breaking Change Minimum supported Rust version is now 1.58.
#[must_use] attributes to many crate functions, as appropriate.unsafe qualifiers from as_mut_ptr and as_mut_ptr_range to match standard library. By @yescallop.new function that creates and empty string to U16CString and U32CString to match other string types.From implementations for conversion to OsString.Also see the changes in 1.0.0-beta.1 if upgrading from 0.5.1 or earlier.
Breaking Change Minimum supported Rust version is now 1.56.
U16String and U32String have been renamed and replaced by functions with different semantics:
pop is now pop_charremove is now remove_charinsert is now insert_chariter::Utf16Chars renamed to CharsUtf16 and moved to ustr and ucstriter::Utf32Chars renamed to CharsUtf32 and moved to ustr and ucstriter::CharsLossy split and renamed to CharsLossyUtf16 and CharsLossyUtf32 and moved to ustr and ucstriter::Utf16CharIndices renamed to CharIndicesUtf16 and moved to ustr and ucstriter::Utf16CharIndicesLossy renamed to CharIndicesLossyUtf16 and moved to ustr and ucstrerror::FromUtf16Error and error::FromUtf32Error has been renamed to Utf16Error and Utf32Error respectively and expanded with more details about the error.U16Str and U32Str are now const:
from_sliceas_sliceas_ptrlenis_emptyU16CStr and U32CStr are now const:
from_slice_uncheckedas_slice_with_nulas_ptrlenis_emptyU16String and U32String are now const:
newUtf16StrUtf32StrUtf16StringUtf32Stringconst wide string slices:
u16str!u16cstr!u32str!u32cstr!widestr!widecstr!utf16str!utf32str!NUL_TERMINATOR associated constant to U16CStr, U32CStr, U16CString, and U32CString.DoubleEndedIterator and ExactSizeIterator implementations to a number of iterator types.encode_utf8encode_utf16encode_utf32repeat on U16Str, U32Str, U16CStr, and U32CStrshrink_to on U16String and U32Stringretain on U16String and U32Stringdrain on U16String and U32Stringreplace_range on U16String and U32Stringget, get_mut, get_unchecked, and get_unchecked_mut on U16CStr and U32CStrsplit_at and split_at_mut on U16CStr and U32CStrU16Str instead of UStr<u16>).
UCharUStrUCStrUStringUCStringIndexMut<RangeFull> trait implementation of U16CString and U32CString. Use the unsafe get_mut method instead, which also supports more ranges.U16Str::char_indices and U16CStr::char_indices is now over (usize, Result<char, DecodeUtf16Error>) tuples instead of the reverse order, to better match standard library string iterators. The same is true of U16Str::char_indices_lossy and U16CStr::char_indices_lossy. This matches what was stated in original documentation.U32Str::to_string and U32CStr::to_string now only allocate once instead of twice.Fixed a regression in 0.5.0 where zero-length vectors and strings were incorrectly causing panics in UCString::from_vec and UCString::from_str . Fixes
UCString::from_vec and UCString::from_str. Fixes #22.ustr::to_string & ustr::to_string_lossy to remove possibly unsafe behaviour.Breaking Change Renamed a number of types and functions to increase consistency and clarity. This also meant renaming errors to more clearly convey er…
MissingNulError => error::MissingNulTerminatorFromUtf32Error => error::FromUtf32ErrorNulError => error::ContainsNulUCStr::from_ptr_with_nul => from_ptr_uncheckedUCStr::from_slice_with_nul => from_slice_truncateUCStr::from_slice_with_nul_unchecked => from_slice_uncheckedU32CStr::from_char_ptr_with_nul => from_char_ptr_uncheckedU32CStr::from_char_slice_with_nul => from_char_slice_truncateU32CStr::from_char_slice_with_nul_unchecked => from_char_slice_uncheckedUCString::new => from_vecUCString::from_vec_with_nul => from_vec_truncateUCString::from_ustr_with_nul => from_ustr_truncateUCString::from_ptr_with_nul => from_ptr_truncateUCString::from_str_with_nul => from_str_truncateUCString::from_os_str_with_nul => from_os_str_truncateU32CString::from_chars_with_nul => from_chars_truncateU32CString::from_char_ptr_with_nul => from_char_ptr_truncateerror module instead.Debug implementations. No more debugging lists of raw integer values.decode_utf16, decode_utf16_lossy, decode_utf32, and decode_utf32_lossy and associated iterators. Note that decode_utf16 is an alias of core::char::decode_utf16, but provided for consistency.display method to to both UStr and UCStr to display strings in formatting without heap allocations, similar to Path::display. Fixes #20.Write trait. Fixes #19.UStr::from_ptr_mutUStr::from_slice_mutUStr::as_mut_sliceUStr::as_mut_ptrUStr::as_ptr_rangeUStr::as_mut_ptr_rangeUStr::getUStr::get_mutUStr::get_uncheckedUStr::get_unchecked_mutUStr::split_atUStr::split_at_mutUStr::charsUStr::chars_lossyU16Str::char_indicesU16Str::char_indices_lossyU32Str::from_char_ptr_mutU32Str::from_char_slice_mutUCStr::from_ptrUCStr::from_ptr_truncateUCStr::from_sliceUCStr::as_ustrUCStr::from_ptr_str_mutUCStr::from_ptr_mutUCStr::from_ptr_truncate_mutUCStr::from_ptr_unchecked_mutUCStr::from_slice_mutUCStr::from_slice_truncate_mutUCStr::from_slice_unchecked_mutUCStr::as_mut_sliceUCStr::as_mut_ptrUCStr::as_ustr_with_nulUCStr::as_mut_ustrUCStr::as_ptr_rangeUCStr::as_mut_ptr_rangeUCStr::charsUCStr::chars_lossyU16CStr::char_indicesU16CStr::char_indices_lossyU32CStr::from_char_ptr_str_mutU32CStr::from_char_ptr_mutU32CStr::from_char_ptr_truncate_mutU32CStr::from_char_ptr_unchecked_mutU32CStr::from_char_slice_mutU32CStr::from_char_slice_truncate_mutU32CStr::from_char_slice_unchecked_mutU32CStr::from_char_ptrU32CStr::from_char_ptr_truncateU32CStr::from_char_sliceUString::as_vecUString::as_mut_vecUString::push_charUString::truncateUString::popUString::removeUString::insertUString::insert_ustrUString::split_offUCString::as_mut_ucstrUCString::into_ustringUCString::into_ustring_with_nulU32CString::from_char_ptr_strUCString::from_vec_with_nul_unchecked. Use from_vec_unchecked instead.UCString::from_ustr_with_nul_unchecked. Use from_ustr_unchecked instead.UCString::from_ptr_with_nul_unchecked. Use from_ptr_unchecked instead.UCString::from_str_with_nul_unchecked. Use from_str_unchecked instead.UCString::from_os_str_with_nul_unchecked. Use from_os_str_unchecked instead.U32CString::from_chars_with_nul_unchecked. Use from_chars_unchecked instead.U32CString::from_char_ptr_with_nul_unchecked. Use from_char_ptr_unchecked instead.Nothing published for this version
Fixed compile errors on pre-1.36.0 Rust due to unstable alloc crate. Minimum supported version is Rust 1.34.2, the rust version for Debian stable. Fix
alloc crate. Minimum supported version is Rust 1.34.2, the rust version for Debian stable. Fixes #14Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →