Skip to content

Allow a full range of unicode characters in text messages - #4937

Open
quis wants to merge 2 commits into
mainfrom
allow-unicode-sms
Open

Allow a full range of unicode characters in text messages#4937
quis wants to merge 2 commits into
mainfrom
allow-unicode-sms

Conversation

@quis

@quis quis commented Aug 17, 2026

Copy link
Copy Markdown
Member

@quis
quis force-pushed the allow-unicode-sms branch from d24fec0 to 2eefcd6 Compare August 17, 2026 10:49
@quis quis changed the title Allow unicode sms Allow a full range of unicode characters in text messages Aug 17, 2026
Base automatically changed from bump-utils-125.0.1 to main August 17, 2026 13:24
@quis
quis force-pushed the allow-unicode-sms branch from 2eefcd6 to a10271c Compare August 21, 2026 09:09
@quis
quis force-pushed the allow-unicode-sms branch from a10271c to 27233d2 Compare September 1, 2026 09:38
@quis
quis marked this pull request as ready for review September 1, 2026 09:40
if non_gsm_characters := template.non_gsm_characters:
current_app.logger.warning(
"%s character(s) replaced with ? in SMS content for service %s and notification %s",
"%s character(s) caused UTF-16 encoding in SMS content for service %s and notification %s",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still want this log to be a warning? Since this will be an expected thing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure it will be useful initially to see adoption of the feature, but we can remove it eventually

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move the log type from warning to info though?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, can do, changed in 439c519

quis added 2 commits September 1, 2026 14:29
If they are in a template or personalisation, start sending them to the
message’s recipients.

***

Includes bumping utils to 128.0.0

 ## 128.0.0

* Allows a full range of unicode characters in text messages
* Removes `SanitiseSMS.downgrade_character` and `SanitiseSMS.encode_char`, `SanitiseSMS.WELSH_DIACRITICS` and `SanitiseSMS.ALLOWED_CHARACTERS` (should not be used anywhere)
* Removes `SanitiseSMS.get_non_gsm_characters()` (use `template.non_gsm_characters` instead)
* `formatters.normalise_whitespace_and_newlines` and `formatters.normalise_whitespace` have a new, optional `preserve_zero_width_joiner` argument (no change in behaviour if not set to `True`)

 ## 127.1.0

* Adds additional methods to `recipient_validation.phone_number.PhoneNumber`, `is_uk_mobile_number` and `get_carrier_info`

***

Complete changes: alphagov/notifications-utils@127.0.0...128.0.0
Non-GSM characters in text message content is an expected behaviour now,
not something which needs warning about.
@quis
quis force-pushed the allow-unicode-sms branch from 27233d2 to 439c519 Compare September 1, 2026 13:35
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.

2 participants