pub fn to_string_lossy(&self) -> String {
        let chars: Vec<char> = self
            .inner
            .iter()
            .map(|&c| char::from_u32(c).unwrap_or(char::REPLACEMENT_CHARACTER))
            .collect();
        let size = chars.iter().map(|c| c.len_utf8()).sum();
        let mut vec = Vec::with_capacity(size);
        unsafe { vec.set_len(size) };
        let mut i = 0;
        for c in chars {
            c.encode_utf8(&mut vec[i..]);
            i += c.len_utf8();
        }
        unsafe { String::from_utf8_unchecked(vec) }
    }
/// Copies the wide string to a `String`.
///
/// Any non-Unicode sequences are replaced with *U+FFFD REPLACEMENT CHARACTER*.
///
/// # Examples
///
/// ```rust
/// use widestring::U32String;
/// let s = "MyString";
/// // Create a wide string from the string
/// let wstr = U32String::from_str(s);
/// // Create a regular string from the wide string
/// let lossy = wstr.to_string_lossy();
///
/// assert_eq!(lossy, s);
/// ```
Copies the wide string to a `String`.
Any non-Unicode sequences are replaced with *U+FFFD REPLACEMENT CHARACTER*.
Copies the wide string to a ` String ` . Any non - Unicode sequences are replaced with * U + FFFD REPLACEMENT CHARACTER * .
pub fn to_string_lossy(&self) -> String {
        let chars: Vec<char> = self
            .inner
            .iter()
            .map(|&c| char::from_u32(c).unwrap_or(char::REPLACEMENT_CHARACTER))
            .collect();
        let size = chars.iter().map(|c| c.len_utf8()).sum();
        let mut vec = Vec::with_capacity(size);
        unsafe { vec.set_len(size) };
        let mut i = 0;
        for c in chars {
            c.encode_utf8(&mut vec[i..]);
            i += c.len_utf8();
        }
        unsafe { String::from_utf8_unchecked(vec) }
    }
pub fn to_string_lossy ( & self ) -> String { let chars : Vec < char > = self . inner . iter ( ) . map ( | & c | char :: from_u32 ( c ) . unwrap_or ( char :: REPLACEMENT_CHARACTER ) ) . collect ( ) ; let size = chars . iter ( ) . map ( | c | c . len_utf8 ( ) ) . sum ( ) ; let mut vec = Vec :: with_capacity ( size ) ; unsafe { vec . set_len ( size ) } ; let mut i = 0 ; for c in chars { c . encode_utf8 ( & mut vec [ i .. ] ) ; i += c . len_utf8 ( ) ; } unsafe { String :: from_utf8_unchecked ( vec ) } }
Copies the wide string to a `String`.
Copies the wide string to a ` String ` .
&self
&self
examples
```rust
use widestring::U32String;
let s = "MyString";
Create a wide string from the string
let wstr = U32String::from_str(s);
Create a regular string from the wide string
let lossy = wstr.to_string_lossy().


` ` ` rust use widestring :: U32String ; let s = " MyString " ; Create a wide string from the string let wstr = U32String :: from_str ( s ) ; Create a regular string from the wide string let lossy = wstr . to_string_lossy () .