fix(telegram): guard UTF-16 surrogate pairs in outbound chunkers (#93938)

Merged via squash.

Prepared head SHA: 583b22354d
Co-authored-by: Nas01010101 <156536069+Nas01010101@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
This commit is contained in:
nas
2026-06-17 06:56:25 -04:00
committed by GitHub
parent 5d9c010628
commit df87b40bec
10 changed files with 221 additions and 9 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export function avoidTrailingHighSurrogateBreak(text: string, start: number, end
return end;
}
const adjusted = end - 1;
return adjusted > start ? adjusted : end;
return adjusted > start ? adjusted : end + 1;
}
export function chunkTextByBreakResolver(