Permalink
Browse files

add

  • Loading branch information...
soarpenguin committed Dec 10, 2013
1 parent d3f77a6 commit 9020a40fbaadb5faad903e4c17039a6ec8ea9974
Showing with 12 additions and 0 deletions.
  1. +12 −0 demo.pl
View
12 demo.pl
@@ -69,3 +69,15 @@ sub version {
exit;
}
+# workaround for functions that don't cope with utf8 well
+sub to_utf8($) {
+ my ($str) = @_;
+ utf8::decode($str) unless utf8::is_utf8($str);
+ return $str;
+}
+sub readlink_utf8($) {
+ my ($filename) = @_;
+ return to_utf8(readlink($filename));
+}
+sub realpath($) { return to_utf8(Cwd::realpath(@_)); }
+sub bsd_glob($) { return map {to_utf8($_)} File::Glob::bsd_glob(@_); }

0 comments on commit 9020a40

Please sign in to comment.