-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Tracking Issue for explicit-endian String::from_utf16 #116258
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-api-nominatedNominated for discussion during a libs-api team meeting.Nominated for discussion during a libs-api team meeting.S-waiting-on-fcpStatus: PR is in FCP and is awaiting for FCP to complete.Status: PR is in FCP and is awaiting for FCP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-api-nominatedNominated for discussion during a libs-api team meeting.Nominated for discussion during a libs-api team meeting.S-waiting-on-fcpStatus: PR is in FCP and is awaiting for FCP to complete.Status: PR is in FCP and is awaiting for FCP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.
Type
Fields
Give feedbackNo fields configured for issues without a type.
View all comments
Feature gate:
#![feature(str_from_utf16_endian)]This is a tracking issue for versions of
String::from_utf16which take&[u8]and use a specific endianness.Public API
Steps / History
Unresolved Questions
from_utf16le,from_utf16_le,from_le_utf16,from_le_utf16_bytes, and other such combinations.with_capacity+pushimplementation used forfrom_utf16whilecollectdoesn't reserve capacity? (Collecting into a Result<Vec<_>> doesn't reserve the capacity in advance #48994)FromUtf16Errorcurrently displays as"invalid utf-16: lone surrogate found"which isn't correct for an error due to odd byte length.from_utf16method takes&[u16]so can't have the odd-length problem that&[u8]can.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩