Skip to content

Expose an UTF-8 checking function that returns the index of the error #860

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

Closed
steveklabnik opened this issue Feb 15, 2015 · 1 comment
Closed
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by Jurily
Monday Feb 10, 2014 at 22:43 GMT

For earlier discussion, see rust-lang/rust#12168

This issue was labelled with: A-libs in the Rust repository


Use case:

  • reporting the position of the error to the user

Possible candidates:

  • mark first_non_utf8_index() as public
  • change from_utf8{_owned}'s return type from Option to Result<_, uint>

Since it's possible to recover from such an error, it would also be nice if these returned all encoding errors.

@aturon
Copy link
Member

aturon commented Feb 16, 2015

This has actually been resolved: http://static.rust-lang.org/doc/master/std/str/fn.from_utf8.html

@aturon aturon closed this as completed Feb 16, 2015
@petrochenkov petrochenkov added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants