Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for string_from_utf8_lossy_owned #129436

Open
1 of 3 tasks
okaneco opened this issue Aug 23, 2024 · 0 comments
Open
1 of 3 tasks

Tracking Issue for string_from_utf8_lossy_owned #129436

okaneco opened this issue Aug 23, 2024 · 0 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-string_from_utf8_lossy_owned T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@okaneco
Copy link
Contributor

okaneco commented Aug 23, 2024

Feature gate: #![feature(string_from_utf8_lossy_owned)]

This is a tracking issue for lossy UTF-8 conversion from Vec<u8> to String.

Public API

impl String {
    pub fn from_utf8_lossy_owned(v: Vec<u8>) -> String;
}
impl FromUtf8Error {
    pub fn into_utf8_lossy(self) -> String {
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@okaneco okaneco added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 23, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 15, 2024
Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods

Accepted ACP: rust-lang/libs-team#116
Tracking issue: rust-lang#129436

Implement feature for lossily converting from `Vec<u8>` to `String`
- Add `String::from_utf8_lossy_owned`
- Add `FromUtf8Error::into_utf8_lossy`

---
Related to rust-lang#64727, but unsure whether to mark it "fixed" by this PR.
That issue partly asks for in-place replacement of the original allocation. We fulfill the other half of that request with these functions.

closes rust-lang#64727
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 15, 2024
Rollup merge of rust-lang#129439 - okaneco:vec_string_lossy, r=Noratrieb

Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods

Accepted ACP: rust-lang/libs-team#116
Tracking issue: rust-lang#129436

Implement feature for lossily converting from `Vec<u8>` to `String`
- Add `String::from_utf8_lossy_owned`
- Add `FromUtf8Error::into_utf8_lossy`

---
Related to rust-lang#64727, but unsure whether to mark it "fixed" by this PR.
That issue partly asks for in-place replacement of the original allocation. We fulfill the other half of that request with these functions.

closes rust-lang#64727
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 21, 2024
…atrieb

Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`

Part of the unstable feature `string_from_utf8_lossy_owned` - rust-lang#129436

Refactor `FromUtf8Error::into_utf8_lossy` to copy valid UTF-8 bytes into the buffer, avoiding double validation of bytes.
Add tests that mirror the `String::from_utf8_lossy` tests.
compiler-errors added a commit to compiler-errors/rust that referenced this issue Sep 21, 2024
…atrieb

Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`

Part of the unstable feature `string_from_utf8_lossy_owned` - rust-lang#129436

Refactor `FromUtf8Error::into_utf8_lossy` to copy valid UTF-8 bytes into the buffer, avoiding double validation of bytes.
Add tests that mirror the `String::from_utf8_lossy` tests.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2024
Rollup merge of rust-lang#130408 - okaneco:into_lossy_refactor, r=Noratrieb

Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`

Part of the unstable feature `string_from_utf8_lossy_owned` - rust-lang#129436

Refactor `FromUtf8Error::into_utf8_lossy` to copy valid UTF-8 bytes into the buffer, avoiding double validation of bytes.
Add tests that mirror the `String::from_utf8_lossy` tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-string_from_utf8_lossy_owned T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants