diff --git a/lib/orrg.pm b/lib/orrg.pm
index c741eccf9fc87961dcfcb3f8f68276f2ddcd8edd..07b0be1940e3dbc60540ce49eba956d7b1a4cfeb 100755
--- a/lib/orrg.pm
+++ b/lib/orrg.pm
@@ -44,7 +44,7 @@ {
(-f $recentfile) or return undef;
my @recents = ();
- open INFILE, $recentfile;
+ open INFILE, '< :encoding(UTF-8)', $recentfile;
flock INFILE, 1;
while (<INFILE>) {
chomp($_);
@@ -62,7 +62,7 @@ my ( $uri, $name ) = @_;
my $recent = recent_get();
my $newline = "$uri $name";
- open OUTFILE, '>', $recentfile;
+ open OUTFILE, '> :encoding(UTF-8)', $recentfile;
flock OUTFILE, 1;
print OUTFILE "$newline\n";
@@ -83,7 +83,7 @@ {
(-f $popularfile) or return undef;
my @populars = ();
- open INFILE, $popularfile;
+ open INFILE, '< :encoding(UTF-8)', $popularfile;
flock INFILE, 1;
while (<INFILE>) {
chomp($_);
@@ -100,7 +100,7 @@ {
my ( $uri, $name ) = @_;
my $populars = popular_get();
- open OUTFILE, '>', $popularfile;
+ open OUTFILE, '> :encoding(UTF-8)', $popularfile;
flock OUTFILE, 1;
my $found = 0;
diff --git a/orrg.pl b/orrg.pl
index eb3842dcbcca748d184b3664608c8f58991e197b..7e26b51dc7c7ec270324b43d2517919ad3eb0ed1 100755
--- a/orrg.pl
+++ b/orrg.pl
@@ -85,7 +85,6 @@ $desc =~ s/^\r\n$//igm;
$desc =~ s/^\s+\*/*/igm;
$desc =~ s/\s+$//igm;
$desc =~ s/^\s+//igm;
- chomp $desc;
push @item, $desc;
}
$link eq '' or push @item, ('=> '.$link.' open entry in browser', '');