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

Normalize Newline Characters for SMS Count #25

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

Conversation

ba5liel
Copy link

@ba5liel ba5liel commented Jan 10, 2024

  • Standardize newline characters to \n across different platforms.
  • Improve SMS character count accuracy.

Overview

This PR introduces a small but crucial change to the count function in the SMS counting logic. It normalizes newline characters across different operating systems by converting all \r\n (Carriage Return + Line Feed) to \n (Line Feed). This change ensures that the SMS character count is consistent and accurate regardless of the platform the text is coming from.

Changes Made

  • Added a line in the count function to replace \r\n with \n.
  • Ensured that the modified count function accurately reflects the length of the text for SMS counting.

Impact

  • This change ensures consistency in SMS character counting across different platforms (Windows, Unix/Linux).
  • It addresses the issue where newline characters were counted differently in different operating systems, leading to discrepancies in SMS part calculations.

Tests and Safety

  • This change has been tested locally to ensure that the SMS count remains accurate and consistent.
  • The modification is minimal and contained, reducing the risk of any unforeseen impacts on the rest of the system.

- Standardize newline characters to `\n` across different platforms.
- Improve SMS character count accuracy.
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