Comments (5)
String has only one method for this, but shouldn't it be three methods? UTF-16 in native, little and big endian.
from compact_str.
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(...)
from compact_str.
Side note: looks like @CAD97 has a PR to introduce this to the stdlib too! rust-lang/rust#95967
from compact_str.
Also cc @NobodyXu, any thoughts here?
from compact_str.
Also cc @NobodyXu, any thoughts here?
I'm not that familiar with utf16
APIs, but this looks alright to me.
from compact_str.
Related Issues (20)
- Rethink `new_inline()` and `from_static_str()` HOT 2
- Safer Repr? HOT 6
- CompactString::as_mut_bytes returns a &mut reference to uninitialized bytes HOT 1
- Consider implementing From<CompactString> for std::error::Error HOT 3
- Typo Error
- Dual License with MIT and Apache 2.0 HOT 1
- Merge compact_bytes
- f64::to_compact_string differs from to_string HOT 2
- Align `InlineBuffer` same as `CompactStr` HOT 5
- Improve efficiency of `is_empty` HOT 10
- Add support for holding Arc<str> as a new repr? HOT 3
- `NonNull` vs `*const` in Repr HOT 9
- Shave an instruction off `len()` HOT 10
- Fuzz Failure! 7662709451 HOT 1
- Fuzz Failure! 7953253492 HOT 1
- Fuzz Failure! 7959979384 HOT 1
- Fuzz Failure! 7967129436 HOT 1
- Fuzz Failure! 7973919521 HOT 1
- Fuzz Failure! 7982539780 HOT 1
- Fuzz Failure! 7989494670 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compact_str.