mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 04:15:48 -06:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user