compact_str
compact_str copied to clipboard
feat: Implement the from_utf16_lossy(...) API
This issue for tracking the implementation of the from_utf16_lossy(...)
method that exists on String
.
String has only one method for this, but shouldn't it be three methods? UTF-16 in native, little and big endian.
Great point, lets do it! What do you think about supporting the following 6 APIs:
-
from_utf16(...)
(native endianness) -
from_utf16_lossy(...)
(native endianness) -
from_utf16_be(...)
-
from_utf16_be_lossy(...)
-
from_utf16_le(...)
-
from_utf16_le_lossy(...)
Side note: looks like @CAD97 has a PR to introduce this to the stdlib too! https://github.com/rust-lang/rust/pull/95967
Also cc @NobodyXu, any thoughts here?
Also cc @NobodyXu, any thoughts here?
I'm not that familiar with utf16
APIs, but this looks alright to me.