Is this crate potentially helpful for applications that want to accept inputs in multiple encodings? Could be helpful to note how it relates to the "encoding" crate, if at all.
-
-
-
I don't think so. I'm not sure i understand where the confusion lies. Byte strings are just bytes, which are conventionally interpreted as one specific encoding: utf8.
- 1 more reply
New conversation -
-
-
Hope there’s a short (in keystrokes) way to turn a bstr to a bstring. &str to string is too verbose considering how often it is done. The other way just requires one character.
-
For allocation it's better to be verbose and visible to make sure it's not done by accident.
- 5 more replies
New conversation -
-
-
hmm could use a "why not [u8] / Vec<u8>" FAQ IMO since I kept saying we should add more useful APIs to slices, instead of special types, for a while now
-
Maybe some day, but we have to start somewhere. There's a fair bit of stuff in bstr that would probably not make it into std.
- 2 more replies
New conversation -
-
-
I always thought the sole purpose of OsStr/OsString existence was to handle non-UTF8 stringy blobs?
-
Almost. It has an additional requirement which is that it must roundtrip the data losslessly, and must be cheap to construct from valid utf8. It's meant to abstract over OS apis.
End of conversation
New conversation -
-
-
Like https://docs.rs/raw-string/ ;) (Though, BStr is worked out in a lot more detail. :) )
-
Indeed. raw-string isn't the only one, there are a few other crates in this space as well. But none of them were complete. raw-string, for example, doesn't have substring search. (Among several other things.) bstr will be getting osstr/path conversions soon. :-)
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.