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

feat: Implement the from_utf16_lossy(...) API #136

Closed
ParkMyCar opened this issue Jun 30, 2022 · 5 comments · Fixed by #210
Closed

feat: Implement the from_utf16_lossy(...) API #136

ParkMyCar opened this issue Jun 30, 2022 · 5 comments · Fixed by #210
Labels
string API Issues related to matching the API of std::String

Comments

@ParkMyCar
Copy link
Owner

This issue for tracking the implementation of the from_utf16_lossy(...) method that exists on String.

@ParkMyCar ParkMyCar added the string API Issues related to matching the API of std::String label Jun 30, 2022
@Kijewski
Copy link
Contributor

String has only one method for this, but shouldn't it be three methods? UTF-16 in native, little and big endian.

@ParkMyCar
Copy link
Owner Author

ParkMyCar commented Aug 13, 2022

Great point, lets do it! What do you think about supporting the following 6 APIs:

  1. from_utf16(...) (native endianness)
  2. from_utf16_lossy(...) (native endianness)
  3. from_utf16_be(...)
  4. from_utf16_be_lossy(...)
  5. from_utf16_le(...)
  6. from_utf16_le_lossy(...)

@ParkMyCar
Copy link
Owner Author

Side note: looks like @CAD97 has a PR to introduce this to the stdlib too! rust-lang/rust#95967

@ParkMyCar
Copy link
Owner Author

Also cc @NobodyXu, any thoughts here?

@NobodyXu
Copy link
Contributor

Also cc @NobodyXu, any thoughts here?

I'm not that familiar with utf16 APIs, but this looks alright to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
string API Issues related to matching the API of std::String
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants