From 3416900c897b578be3493a9e1c41e0209e7b9442 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:06:25 +0300 Subject: [PATCH] fix(backwards): backwards funbox doesn't handle complex characters --- frontend/src/ts/test/funbox/funbox-functions.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/test/funbox/funbox-functions.ts b/frontend/src/ts/test/funbox/funbox-functions.ts index 7430c0b6bae6..8736db5357c4 100644 --- a/frontend/src/ts/test/funbox/funbox-functions.ts +++ b/frontend/src/ts/test/funbox/funbox-functions.ts @@ -348,7 +348,15 @@ const list: Partial> = { }, backwards: { alterText(word: string): string { - return word.split("").reverse().join(""); + let chars; + if ("Segmenter" in Intl) { + const segmenter = new Intl.Segmenter(); + const segments = segmenter.segment(word); + chars = [...segments].map((segment) => segment.segment); + } else { + chars = [...word]; + } + return chars.reverse().join(""); }, }, capitals: {