Repository navigation
Lowercase non-ASCII words in words() - #95
Conversation
strtolower() only touches ASCII letters, so words like "Ёлка" or "Über" kept their capital. Use mb_strtolower() when it's available, same as LowercaseModifier does.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthrough
ChangesWord normalization
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The Unicode test is compatible with the supported test setup. No issue identified here prevents merging after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nice fix, thanks for the contribution ! |
words() runs the result through strtolower(), which only knows ASCII. With a Cyrillic or accented locale you get things like "Прадукцыя" or "Écrit" back with the capital still there.
This switches to mb_strtolower(), with the same mbstring check and fallback that LowercaseModifier already uses. Added a test with Cyrillic, French and German words.
Came up while writing the be_BY locale (#94).
Summary by CodeRabbit