From 8aa79fcf1aa8cb3ed9433be8b0b6a06a17050a93 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Tue, 19 Dec 2023 06:43:44 +0100 Subject: [PATCH] unicode chat handling --- code/_helpers/text.dm | 4 ++++ code/modules/mob/hear_say.dm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 07a2bfaceb6..b5328462454 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -255,6 +255,10 @@ /proc/capitalize(var/t as text) return uppertext(copytext(t, 1, 2)) + copytext(t, 2) +//Returns a unicode string with the first element of the string capitalized. +/proc/capitalize_utf(var/t as text) + return uppertext(copytext_char(t, 1, 2)) + copytext_char(t, 2) + //This proc strips html properly, remove < > and all text between //for complete text sanitizing should be used sanitize() /proc/strip_html_properly(var/input) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 6d59392cf79..10d2b91aaf8 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -22,7 +22,7 @@ return if(iteration_count == 1) - piece = capitalize(piece) + piece = capitalize_utf(piece) if(always_stars) piece = stars(piece)