Fix `debug_non_utf8_classname` on non-MacRoman systems #878
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 158 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.303
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #878"
general
weight: 0.35
madsmtm
Fixes https://github.com/madsmtm/objc2/issues/863.
Problem
debug_non_utf8_classnameregisters a class whose name contains invalid UTF-8 (My\xF0\x90\x80Class), and compares theDebugoutput of an instance against a hardcoded string.-descriptiondecodes the name using the system text encoding, but the hardcoded string is what you get with MacRoman, so the test fails on machines that use a different encoding, such as when the system language is set to Japanese:Fix
Build the expected class name from
[cls description]instead, which is decoded the same way. Since this only changes a test, I didn't add a changelog entry.Testing
On macOS 26.6.2 (Aarch64),
cargo test -p objc2 --lib debug_non_utf8_classnamepasses with__CF_USER_TEXT_ENCODINGset to MacRoman, Japanese, Traditional Chinese, Korean, Cyrillic and Simplified Chinese. Without the fix, it fails with everything except MacRoman, and I also confirmed that switching the system language between Japanese and English changes the result.The rest of
cargo test -p objc2passes with MacRoman and Japanese, as docargo fmt -- --checkandcargo clippy -p objc2 --all-targets.