Skip to content

Fix counting of UTF-8 codepoints in TextFlow#3086

Merged
horenmar merged 1 commit intocatchorg:develfrom
jhasse:textflow-utf-8
Apr 1, 2026
Merged

Fix counting of UTF-8 codepoints in TextFlow#3086
horenmar merged 1 commit intocatchorg:develfrom
jhasse:textflow-utf-8

Conversation

@jhasse
Copy link
Copy Markdown
Contributor

@jhasse jhasse commented Mar 28, 2026

Description

For line-wrapping bytes were counted instead of codepoints. This resulted in line-breaks being inserted at the wrong position and also breaking UTF-8 characters.

Maybe AnsiSkippingString should be renamed to Utf8SkippingString now?

GitHub Issues

Fixes #1022.

For line-wrapping bytes were counted instead of codepoints. This
resulted in line-breaks being inserted at the wrong position and also
breaking UTF-8 characters.

Fixes catchorg#1022.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.35%. Comparing base (ccc49ba) to head (1e14c3a).
⚠️ Report is 5 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3086      +/-   ##
==========================================
+ Coverage   91.34%   91.35%   +0.01%     
==========================================
  Files         204      204              
  Lines        8899     8912      +13     
==========================================
+ Hits         8128     8141      +13     
  Misses        771      771              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@horenmar
Copy link
Copy Markdown
Member

horenmar commented Apr 1, 2026

Maybe AnsiSkippingString should be renamed to Utf8SkippingString now?

Utf8AndAnsiControlCodesSkippingString 🙃

Dumb jokes aside, historically Catch2 did not try to handle non-ascii text (with minor concessions here and there), because of the sad state of C++ support for doing so. I think this is unobtrusive-enough to be worth it though.

Thanks

@horenmar horenmar merged commit 572f96b into catchorg:devel Apr 1, 2026
88 checks passed
@jhasse jhasse deleted the textflow-utf-8 branch April 1, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect line wrapping when test case name is consisted by non-ascii characters

2 participants