Skip to content

Create case formatters#13

Open
henriquemoody wants to merge 2 commits intoRespect:mainfrom
henriquemoody:case_formatters
Open

Create case formatters#13
henriquemoody wants to merge 2 commits intoRespect:mainfrom
henriquemoody:case_formatters

Conversation

@henriquemoody
Copy link
Member

No description provided.

@henriquemoody henriquemoody requested a review from alganet February 6, 2026 20:26
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.46%. Comparing base (801a389) to head (d6d59d5).

Additional details and impacted files
@@            Coverage Diff            @@
##               main      #13   +/-   ##
=========================================
  Coverage     99.45%   99.46%           
- Complexity      155      157    +2     
=========================================
  Files            23       25    +2     
  Lines           368      372    +4     
=========================================
+ Hits            366      370    +4     
  Misses            2        2           

☔ 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.

The new UppercaseFormatter provides reliable UTF-8 aware uppercase
conversion for international text, ensuring accented characters and
non-Latin scripts are handled correctly using mb_strtoupper().

This formatter is essential for applications requiring proper
internationalization support when manipulating text in various
languages like French, German, Turkish, Greek, Cyrillic, and CJK
languages.

Includes comprehensive tests covering ASCII, Latin accents,
non-Latin scripts, emoji, combining diacritics, right-to-left text,
multi-byte characters, and mixed content scenarios.

Assisted-by: OpenCode (GLM-4.7)
The new LowercaseFormatter provides reliable UTF-8 aware lowercase
conversion for international text, ensuring accented characters and
Turkish special cases (İ/i) are handled correctly using mb_strtolower().

This formatter complements UppercaseFormatter and is essential for
applications requiring proper internationalization support when
manipulating text in various languages including those with special
character mapping rules.

Includes comprehensive tests covering ASCII, Latin accents, Turkish
characters, non-Latin scripts, emoji, combining diacritics,
right-to-left text, multi-byte characters, and mixed content.

Assisted-by: OpenCode (GLM-4.7)
Comment on lines +253 to +261
public static function providerForMultiByte(): array
{
return [
'chinese' => ['你好世界', '你好世界'],
'japanese katakana' => ['コンニチハ', 'コンニチハ'],
'korean hangul' => ['안녕하세요', '안녕하세요'],
'cjk characters' => ['简体字繁體字漢字', '简体字繁體字漢字'],
];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure these examples are testing anything. For case conversion, we need to target a script that has different uppercase/lowercase characters.

The cyrilic example is good. Also, portuguese Ç -> ç, Á -> á. I think greek is also a good multibyte example.

At best, this provider should be renamed providerNoCase or something like that. It's important to test that languages that don't have the concept of upper/lower case remain the same.

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.

3 participants