... | ... |
@@ -559,7 +559,7 @@ sub description { |
559 | 559 |
else { |
560 | 560 |
# Read description |
561 | 561 |
return unless -f $file; |
562 |
- my $description = $self->_dec($self->_slurp($file) || ''); |
|
562 |
+ my $description = $self->_dec($self->_slurp($file) || '', 'UTF-8'); |
|
563 | 563 |
return $description; |
564 | 564 |
} |
565 | 565 |
} |
... | ... |
@@ -1669,9 +1669,9 @@ sub _chop_str { |
1669 | 1669 |
} |
1670 | 1670 |
|
1671 | 1671 |
sub _dec { |
1672 |
- my ($self, $str) = @_; |
|
1672 |
+ my ($self, $str, $encoding) = @_; |
|
1673 | 1673 |
|
1674 |
- my $enc = $self->encoding; |
|
1674 |
+ my $enc = $encoding || $self->encoding; |
|
1675 | 1675 |
|
1676 | 1676 |
my $new_str; |
1677 | 1677 |
eval { $new_str = decode($enc, $str) }; |
... | ... |
@@ -1679,14 +1679,6 @@ sub _dec { |
1679 | 1679 |
return $@ ? $str : $new_str; |
1680 | 1680 |
} |
1681 | 1681 |
|
1682 |
-sub _enc { |
|
1683 |
- my ($self, $str) = @_; |
|
1684 |
- |
|
1685 |
- my $enc = $self->encoding; |
|
1686 |
- |
|
1687 |
- return encode($enc, $str); |
|
1688 |
-} |
|
1689 |
- |
|
1690 | 1682 |
sub _mode_str { |
1691 | 1683 |
my $self = shift; |
1692 | 1684 |
my $mode = oct shift; |