# formats.text.TmuxText.to_string_lossy

- **Module:** formats.text.TmuxText
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/formats/text.rs#L91
- **Page:** https://libtmux.org/en/rs/latest/reference/formats-text-tmuxtext-to_string_lossy/

```
formats.text.TmuxText.to_string_lossy(self) -> Cow<'_, str>
```

Decode the stored bytes with replacement characters for invalid UTF-8.

## Example

```rust
use libtmux::TmuxText;

let text = TmuxText::from_bytes(vec![b'a', 0xff]);
assert_eq!(text.to_string_lossy(), "a\u{fffd}");
```
