Skip to content

Conversation

@sakarie9
Copy link

Previously, all characters were treated as 1 unit wide, which caused incorrect truncation for certain characters, such as CJK characters. This resulted in media labels being longer than expected when compared to ASCII characters.

For instance, when the "Media - Truncation Size" is set to 30, the truncation works correctly for alphabetic characters, displaying up to 30 characters. However, for CJK characters, each character was counted as 1 unit, causing the truncation to display approximately twice the width compared to 30 alphabetic characters.

This commit introduces a Regex solution to count full-width characters as 2 units in length. While this approach may not cover every possible full-width character, it should be sufficient for most common scenarios.

@Jas-SinghFSU Jas-SinghFSU self-assigned this Nov 17, 2024
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.

3 participants