Skip to content

Conversation

@henriquemoody
Copy link
Member

No description provided.

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)
Allows precise control over trimming operations with support for left,
right, or both sides and custom character masks, using UTF-8-aware
regex operations for proper international text handling.

The formatter automatically escapes special regex characters in the
custom mask and handles complex multi-byte characters including CJK
spaces, emoji, and combining diacritics which are essential for
global applications.

Includes comprehensive tests covering all trim modes, custom masks,
Unicode characters (CJK, emoji), special characters, multi-byte
strings, and edge cases like empty strings and strings shorter than
the mask.

Assisted-by: OpenCode (GLM-4.7)
The new CreditcardFormatter automatically detects major credit card
types (Visa, MasterCard, Amex, Discover, JCB) based on card prefix
and length, applying the appropriate formatting pattern.

This formatter is essential for payment processing applications that
need to display credit card numbers in a consistent, readable format
while supporting different card types with their specific formatting
requirements (e.g., Amex uses 4-6-5 format while others use 4-4-4-4).

Input is automatically cleaned by removing non-digit characters,
making it flexible for real-world usage where cards may have spaces,
dashes, or other separators.

Includes comprehensive tests covering all major card types, invalid
cards, custom patterns, input cleaning, and edge cases.

Assisted-by: OpenCode (GLM-4.7)
- SecretCreditcardFormatter: Composes CreditCardFormatter and masks
  sensitive portions of credit card numbers. Displays card number
  with only first and last segments visible, masking middle sections.
- Use case: Secure display of credit cards in receipts, billing
  statements, and account summaries where card verification is needed
  but full number must be protected.
- Automatically detects mask range: '6-12' for 15-digit cards (Amex),
  '6-9,11-14' for 16-digit cards (Visa/MasterCard/Discover).

Assisted-by: OpenCode (GLM-4.7)
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.

1 participant