diff options
Diffstat (limited to 'frontend/app/components/GolfPlayApps')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index ba868ab..69da5d9 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -15,11 +15,13 @@ import SubmitStatusLabel from "../SubmitStatusLabel"; import UserIcon from "../UserIcon"; function calcCodeSize(code: string): number { - return code + const trimmed = code .replace(/\s+/g, "") .replace(/^<\?php/, "") .replace(/^<\?/, "") - .replace(/\?>$/, "").length; + .replace(/\?>$/, ""); + const utf8Encoded = new TextEncoder().encode(trimmed); + return utf8Encoded.length; } type Props = { |
