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

Add Unicode.replace_invalid/2 #8

Merged
merged 14 commits into from
Oct 17, 2023
Merged

Add Unicode.replace_invalid/2 #8

merged 14 commits into from
Oct 17, 2023

Conversation

Moosieus
Copy link
Collaborator

Thinking out loud here:

  • Is it worth keeping the notebooks folder + single Livebook? I figure there's an argument for documenting the institutional knowledge, and also an argument for keeping extraneous stuff out of the repo.
  • I considered adding benchmarks for future implementations to compare against. I figure that can be done if/when one presents itself.
  • I didn't get around to identifying what gets replaced in the return value, but I think that's an endeavor unto itself.
  • I'm content with the test cases for now - I even identified a few bugs in the implementation using them! If OTP ever receives a native implementation of this feature, perhaps they can use these tests as well.
  • I didn't write tests for UTF16 and UTF32, but their implementations are pretty simple anyway.

Otherwise, I think this feature's ready to go!

@Moosieus Moosieus requested a review from kipcole9 October 15, 2023 17:57
@kipcole9
Copy link
Collaborator

Cameron, that's great work, thank you. Will review asap but I may be a bit challenged to do that today.

@kipcole9 kipcole9 merged commit f67f049 into main Oct 17, 2023
1 check passed
@kipcole9
Copy link
Collaborator

I've just published Unicode version 1.18.0 with the following changelog entry:

Enhancements

  • Adds Unicode.validate_utf8/3 to force-validate a binary as a UTF-8 string. Any invalid codepoints or incomplete sequences are replaced with a replacement string. Many thanks to @Moosieus for the contribution.

Thanks very much again for the contribution, its greatly appreciated.

@Moosieus Moosieus linked an issue Oct 19, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

U+FFFD Substitution of Maximal Subparts
2 participants