Skip to content

Miscalculates number of messages when extended character is split between messages #1

@Pudge601

Description

@Pudge601

In the 7 bit alphabet, an extended character uses two characters (the escape character and the character itself). This pair is not allowed to be split across messages, so both the escape character and the character itself get shifted into the next message.

The current implementation doesn't handle this properly, and as a result, may miscalculate the number of messages.

An example SMS would be;

The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown f[x jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the.

The '[' at character 152 will become "0x1B[" (2 characters), and become part of the 2nd message, which pushes the last "." at the end of the content into a 3rd message, giving the following 3 messages;

The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown f

[x jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the

.

The current behaviour is that this will return 2 for the number of parts, but it should be returning 3.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions