From bfe252b5c575ae89ca8bcef137a55b31395435cb Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 27 Feb 2026 03:45:59 -0800 Subject: [PATCH] applets/unicode.pl: improve search option --- applets/unicode.pl | 12 +++++++++++- lib/PBot/VERSION.pm | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/applets/unicode.pl b/applets/unicode.pl index 63de5804..6b4c1ce6 100755 --- a/applets/unicode.pl +++ b/applets/unicode.pl @@ -45,7 +45,17 @@ my $result; if ($args =~ /^u\+/i) { $result = `unicode --max=100 --color=off -- \Q$args\E`; } elsif ($search) { - $result = `unicode -r --max=100 --color=off -format 'U+{ordc:04X} {pchar} {name};\n' -- \Q$args\E`; + my @out = (); + if (open(CMD, "-|")) { + while () { + chomp; + push(@out, $_); + } + close CMD; + } else { + exec 'unicode', '-r', '--max=100', '--color=off', '--format', 'U+{ordc:04X} {pchar} {name};\n', '--', "\\b$args\\b"; + } + $result = join "\n", @out; } else { $result = `unicode -s --max=100 --color=off --format 'U+{ordc:04X} ({utf8}) {pchar} {name} Category: {category} ({category_desc}) {opt_unicode_block}{opt_unicode_block_desc}{mirrored_desc}{opt_combining}{combining_desc}{opt_decomp}{decomp_desc};\n' -- \Q$args\E`; } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 8672cc28..81a890f4 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4938, - BUILD_DATE => "2026-02-19", + BUILD_REVISION => 4939, + BUILD_DATE => "2026-02-27", }; sub initialize {}