winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Fix incorrect logic in CharIsPrintable for UnicodeCategory exclusions

Open LeafShi1 opened this issue 1 month ago • 1 comments

Fixes #14072

Proposed changes

  • The original implementation of CharIsPrintable contains a semantic error in the combination of is not and or. As a result, it returns true for any character that is not Control, incorrectly classifying characters from Format, LineSeparator, ParagraphSeparator, and OtherNotAssigned as printable. Impact: Zero-width spaces, line separators, paragraph separators, and unassigned code points are treated as printable, even though they render as invisible, garbled symbols, or empty spaces.
Microsoft Reviewers: Open in CodeFlow

LeafShi1 avatar Nov 25 '25 04:11 LeafShi1

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 77.15293%. Comparing base (b33edbc) to head (7c8973a).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14079         +/-   ##
===================================================
- Coverage   77.15510%   77.15293%   -0.00218%     
===================================================
  Files           3279        3279                 
  Lines         645317      645317                 
  Branches       47718       47719          +1     
===================================================
- Hits          497895      497881         -14     
- Misses        143733      143744         +11     
- Partials        3689        3692          +3     
Flag Coverage Δ
Debug 77.15293% <100.00000%> (-0.00218%) :arrow_down:
integration 18.98651% <0.00000%> (-0.00767%) :arrow_down:
production 52.01413% <100.00000%> (-0.00487%) :arrow_down:
test 97.40749% <ø> (ø)
unit 49.46430% <100.00000%> (+0.00486%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

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

codecov[bot] avatar Nov 25 '25 04:11 codecov[bot]