From f2d3edd79b85e9b44277ad208d20e4dd8a666609 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 21 Jun 2021 11:33:53 -0700 Subject: [PATCH] ValidateString: oops, this string is supposed to be UTF8 --- PBot/Utils/ValidateString.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBot/Utils/ValidateString.pm b/PBot/Utils/ValidateString.pm index 672da7ac..c28229be 100644 --- a/PBot/Utils/ValidateString.pm +++ b/PBot/Utils/ValidateString.pm @@ -12,6 +12,7 @@ our @ISA = qw/Exporter/; our @EXPORT = qw/validate_string/; use JSON; +use Encode; use Unicode::Truncate; # validate_string converts a given string to one that conforms to @@ -85,6 +86,7 @@ sub validate_this_string { # truncate safely if ($max_length > 0) { + $string = encode('UTF-8', $string); $string = truncate_egc $string, $max_length; }