Skip to content

Commit

Permalink
UTF-8 support for the file of channels in the CLI version.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 12, 2020
1 parent a4c7e7a commit 313aaac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -2808,7 +2808,7 @@ sub save_channel_to_file {

$yv_utils->is_channelID($channel_id) || return;

open(my $fh, '>>', $opt{youtube_users_file}) or do {
open(my $fh, '>>:utf8', $opt{youtube_users_file}) or do {
warn "Can't open file <<$opt{youtube_users_file}>> for appending: $!\n";
return;
};
Expand All @@ -2820,7 +2820,7 @@ sub save_channel_to_file {
sub update_channel_file {
my (%channels) = @_;

open(my $fh, '>', $opt{youtube_users_file}) or do {
open(my $fh, '>:utf8', $opt{youtube_users_file}) or do {
warn "Can't open file <<$opt{youtube_users_file}>> for writing: $!\n";
return;
};
Expand All @@ -2834,7 +2834,7 @@ sub update_channel_file {

sub print_channels_from_file {

open(my $fh, '<', $opt{youtube_users_file}) or do {
open(my $fh, '<:utf8', $opt{youtube_users_file}) or do {
warn "Can't open file <<$opt{youtube_users_file}>> for reading: $!\n";
return;
};
Expand Down

0 comments on commit 313aaac

Please sign in to comment.