Skip to content

Commit

Permalink
Fix to treat the strings as proper UTF-8 encoded text rather than raw…
Browse files Browse the repository at this point in the history
… byte strings #115
  • Loading branch information
iliajie committed Oct 25, 2024
1 parent e4ef4b1 commit e5b18ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chfn/linux-lib.pl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]);
Expand Down

0 comments on commit e5b18ab

Please sign in to comment.