Skip to content

Commit 9020a40

Browse files
committed
add
1 parent d3f77a6 commit 9020a40

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

demo.pl

+12
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@ sub version {
6969
exit;
7070
}
7171

72+
# workaround for functions that don't cope with utf8 well
73+
sub to_utf8($) {
74+
my ($str) = @_;
75+
utf8::decode($str) unless utf8::is_utf8($str);
76+
return $str;
77+
}
78+
sub readlink_utf8($) {
79+
my ($filename) = @_;
80+
return to_utf8(readlink($filename));
81+
}
82+
sub realpath($) { return to_utf8(Cwd::realpath(@_)); }
83+
sub bsd_glob($) { return map {to_utf8($_)} File::Glob::bsd_glob(@_); }

0 commit comments

Comments
 (0)