From e5b18ab1bf4b25cfbdd3429ec06658d92b7ddc38 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 25 Oct 2024 19:13:18 +0300 Subject: [PATCH] Fix to treat the strings as proper UTF-8 encoded text rather than raw byte strings #115 --- chfn/linux-lib.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chfn/linux-lib.pl b/chfn/linux-lib.pl index eb100434..6d38a5ed 100755 --- a/chfn/linux-lib.pl +++ b/chfn/linux-lib.pl @@ -1,5 +1,6 @@ # linux-lib.pl # Functions for changing user details on linux +use utf8; # change_details(realname, office, ophone, hphone, shell) sub change_details @@ -8,7 +9,8 @@ sub change_details $a =~ s/\\//g; $a =~ s/'//g; } - +utf8::decode($_[0]) if (!utf8::is_utf8($_[0])); +utf8::decode($_[1]) if (!utf8::is_utf8($_[1])); local @ruser = getpwnam($remote_user); local @uinfo = split(/,/, $ruser[6]);