Mismatch between lengths of UTF-16 and actual Unicode code points

(#4079) Bug Open: Confirmed Priority: P2 api desktop

Reproduction steps

  1. Open any interface that restricts maximum string length.
  2. Enter any string approaching the maximum character limit, but with some SMP characters. (e.g. 𐑛𐑦𐑕𐑣𐑸𐑥𐑩𐑯𐑦 | 最不調和の伝播者 | 異議の元素, my actual display name at 28 characters)
  3. Hit "apply".

Expected behaviour

String length validation passes (28 ≤ 32).
// Please, use either, I just want this bug to be fixed and get it over with.
"use strict";
const isLengthExceeded = function (input, maxLength) {
  let actualSize = 0;
  for (const char of input) {
    actualSize ++;
  };
  return actualSize <= maxLength;
};
// Alternative method
const isLengthExceeded = function (input, maxLength) {
  return Array.from(input).length <= maxLength;
};

Actual behaviour

String length validation fails (37 > 32), both in the browser and in the API.
"use strict";
const isLengthExceeded = function (input, maxLength) {
  return input.length <= maxLength;
};

Build information

Stable Web 2026.1016.10924, Windows NT 10.0 (x64), Firefox 153.0 (Tor Browser), Locale en-GB

Platform

Web, API

1 comment

Sign in with Fluxer to comment and vote.
Comment by Fullest
FullestReviewer 1 vote
Status changed from Needs triage to Confirmed
CR: reproduced using channel title from the mobile app Version 2026.10.100, Channel Canary, Build 2782, Android 16 (arm64), Device Google Pixel 9a, Locale en-US, Push fcm, Flutter 3.47.7, Dart 3.13.5