Ticket #160: mac-encoding.patch
| File mac-encoding.patch, 950 bytes (added by ChrisDolan, 4 years ago) |
|---|
-
lib/Padre/Document.pm
328 328 } 329 329 } else { # fail to get system default encoding 330 330 warn "Could not find encoding of file '$file'. Defaulting to 'utf-8'. " 331 . "Please check it manually and report to the Padre development team."; 331 . "Please check it manually and report to the Padre development team." 332 if ! defined $system_default; 332 333 $self->{encoding} = 'utf-8'; 333 334 } 334 335 $content = Encode::decode($self->{encoding}, $content); … … 374 375 my $content = $self->text_get; 375 376 my $filename = $self->filename; 376 377 377 if (open my $fh, ">:raw:encoding($self->{encoding})", $filename) { 378 my $encoding = $self->{encoding} || 'utf-8'; 379 if (open my $fh, ">:raw:encoding($encoding)", $filename) { 378 380 print {$fh} $content; 379 381 } else { 380 382 return "Could not save: $!";
