Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-1080] Update truncation logic for strings #1105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raghavaggarwal2308
Copy link
Contributor

Summary

In the existing implementation, truncation was occurring at the byte level, which could lead to incorrect handling of multi-byte characters, such as UTF-8 characters.

Changes:

  • Changes have been made to the logic of string truncation to account for multi-byte characters.
  • The usage of the unicode/utf8 package has been added to accurately count characters in the string.
  • String truncation now occurs at the character level, ensuring proper behavior when dealing with multi-byte characters.

Screenshots:
Assumption: Max char length is 30

Earlier:
image

Now:
image

Ticket Link

Fixes #1080

server/webhook_jira.go Show resolved Hide resolved
@raghavaggarwal2308 raghavaggarwal2308 added the 3: QA Review Requires review by a QA tester label Sep 18, 2024
@raghavaggarwal2308 raghavaggarwal2308 added this to the v4.3.0 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix string truncation to properly handle multi-byte characters
3 participants