Skip to content

Conversation

@piotrbartman
Copy link
Member

Added function replaces unacceptable characters with _. I considered replacing _ with the REPLACEMENT CHARACTER (U+FFFD) but the advantage of _ is readability and the single-byte size.

The internal validate_utf8_char function has been renamed to validate_utf8_char_safe_for_display, and the internal logic has been moved to validate_utf8_char_and_return_len, which returns the minus length of unsafe characters. This allows more efficient replacement of multi-byte UTF chars.

Added function replaces unacceptable characters with `_`. I considered replacing `_` with the REPLACEMENT CHARACTER (U+FFFD) but the advantage of `_` is readability and the single-byte size.

The internal `validate_utf8_char` function has been renamed to `validate_utf8_char_safe_for_display`, and the internal logic has been moved to `validate_utf8_char_and_return_len`, which returns the minus length of unsafe characters. This allows more efficient replacement of multi-byte UTF chars.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.96%. Comparing base (40f1963) to head (0ce2e5c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   60.60%   61.96%   +1.35%     
==========================================
  Files           6        6              
  Lines         952      986      +34     
  Branches      104      104              
==========================================
+ Hits          577      611      +34     
  Misses        285      285              
  Partials       90       90              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants