Fix file handling (UTF8 mode).
Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
be39a05f1c
commit
6e68ad79f5
2 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
yapfaq 1.0.0 (unreleased)
|
yapfaq 1.0.0 (unreleased)
|
||||||
* Complete rewrite.
|
* Complete rewrite.
|
||||||
* Add POD.
|
* Add POD.
|
||||||
|
* Fix file handling (UTF8 mode).
|
||||||
|
|
||||||
yapfaq 0.10 (unreleased)
|
yapfaq 0.10 (unreleased)
|
||||||
* Add: Charset definition.
|
* Add: Charset definition.
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ sub BuildPosting {
|
||||||
my($LastPosted, $LastMID);
|
my($LastPosted, $LastMID);
|
||||||
if (-r $StatusFile) {
|
if (-r $StatusFile) {
|
||||||
print "- Reading status ($Project.cfg).\n" if $Config{'debug'};
|
print "- Reading status ($Project.cfg).\n" if $Config{'debug'};
|
||||||
my @Status = path($StatusFile)->lines_utf8;
|
my @Status = path($StatusFile)->lines;
|
||||||
foreach (@Status) {
|
foreach (@Status) {
|
||||||
# convert Windows line-endings to Unix
|
# convert Windows line-endings to Unix
|
||||||
s/\r//;
|
s/\r//;
|
||||||
|
|
@ -389,8 +389,8 @@ sub BuildPosting {
|
||||||
}
|
}
|
||||||
|
|
||||||
print "- Reading headers ($Project.hdr) and body ($Project.txt).\n" if $Config{'debug'};
|
print "- Reading headers ($Project.hdr) and body ($Project.txt).\n" if $Config{'debug'};
|
||||||
my @Headers = path($HeaderFile)->lines_utf8;
|
my @Headers = path($HeaderFile)->lines;
|
||||||
my @Body = path($BodyFile)->lines_utf8;
|
my @Body = path($BodyFile)->lines;
|
||||||
my %Header = &ParseHeaders(@Headers);
|
my %Header = &ParseHeaders(@Headers);
|
||||||
|
|
||||||
# check for mandatory headers
|
# check for mandatory headers
|
||||||
|
|
@ -562,7 +562,7 @@ sub UpdateStatus {
|
||||||
push @Status, "Last-Message-ID: $LastMID\n";
|
push @Status, "Last-Message-ID: $LastMID\n";
|
||||||
|
|
||||||
$StatusFile = path($StatusFile);
|
$StatusFile = path($StatusFile);
|
||||||
$StatusFile->spew_utf8(@Status);
|
$StatusFile->spew(@Status);
|
||||||
|
|
||||||
print "- Status updated.\n" if $Config{'debug'};
|
print "- Status updated.\n" if $Config{'debug'};
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue