Fix file handling (UTF8 mode).

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2026-01-19 23:28:06 +01:00
parent be39a05f1c
commit 6e68ad79f5
2 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,7 @@
yapfaq 1.0.0 (unreleased)
* Complete rewrite.
* Add POD.
* Fix file handling (UTF8 mode).
yapfaq 0.10 (unreleased)
* Add: Charset definition.

View file

@ -372,7 +372,7 @@ sub BuildPosting {
my($LastPosted, $LastMID);
if (-r $StatusFile) {
print "- Reading status ($Project.cfg).\n" if $Config{'debug'};
my @Status = path($StatusFile)->lines_utf8;
my @Status = path($StatusFile)->lines;
foreach (@Status) {
# convert Windows line-endings to Unix
s/\r//;
@ -389,8 +389,8 @@ sub BuildPosting {
}
print "- Reading headers ($Project.hdr) and body ($Project.txt).\n" if $Config{'debug'};
my @Headers = path($HeaderFile)->lines_utf8;
my @Body = path($BodyFile)->lines_utf8;
my @Headers = path($HeaderFile)->lines;
my @Body = path($BodyFile)->lines;
my %Header = &ParseHeaders(@Headers);
# check for mandatory headers
@ -562,7 +562,7 @@ sub UpdateStatus {
push @Status, "Last-Message-ID: $LastMID\n";
$StatusFile = path($StatusFile);
$StatusFile->spew_utf8(@Status);
$StatusFile->spew(@Status);
print "- Status updated.\n" if $Config{'debug'};
return;