From 6206678857c6e42dd524d719c825442af741405a Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sun, 24 Sep 2017 17:11:52 +0200 Subject: fix utf8 filencoding issues --- clerk | 4 ++-- clerk_rating_client | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clerk b/clerk index c7aab4d..51624f9 100755 --- a/clerk +++ b/clerk @@ -372,7 +372,7 @@ sub do_action { if ($tagging eq "true") { $mpd->sticker_value("song", "$uri", "rating", "$rating"); } - $mpd->send_message('rating', "$uri\tRATING\t${rating}"); + $mpd->send_message('rating', encode('UTF-8', "${uri}\tRATING\t${rating}")); } } elsif ($action eq "Add\n" || $action eq "Replace\n") { @@ -410,7 +410,7 @@ sub do_action { my $filename = $songs->{uri}; $mpd->sticker_value("song", $filename, "albumrating", "$rating"); if ($tagging eq "true") { - $mpd->send_message('rating', "$filename\tALBUMRATING\t${rating}"); + $mpd->send_message('rating', encode('UTF-8', "${filename}\tALBUMRATING\t${rating}")); } } } diff --git a/clerk_rating_client b/clerk_rating_client index b65f9c6..b05bc2b 100755 --- a/clerk_rating_client +++ b/clerk_rating_client @@ -4,7 +4,8 @@ binmode(STDOUT, ":utf8"); use v5.10; use warnings; use Array::Utils qw(:all); -#use DDP; +#use DDP { show_unicode => 1 }; +use Data::Dumper; use Try::Tiny; use Config::Simple; use File::Spec; -- cgit v1.2.3-24-g4f1b