Fix Swedish åäö rendering as mojibake in PDF exports

buildSimplePdf's font declared no /Encoding at all, so PDF viewers fell
back to a standard font's built-in encoding, which has no å/ä/ö glyphs
- and separately, the content stream was written as UTF-8 instead of a
single-byte encoding, so even a correctly-encoded font would receive
the wrong bytes (a multi-byte UTF-8 sequence where PDF expects exactly
one byte per character): the classic "åäö" mojibake pattern.

Fixed by declaring /Encoding /WinAnsiEncoding and writing the content
stream through a proper WinAnsi (~CP1252) byte mapper instead of UTF-8.
This is the single shared renderer behind every PDF export (race
results, start lists, heat sheets, team reports, the results archive),
so the fix applies everywhere at once, matching what was reported.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-09-09 21:31:01 +02:00
parent f1959029c7
commit 2bbbd6e995
6 changed files with 89 additions and 7 deletions

View File

@@ -8,6 +8,12 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
## 1.7.1 - 2026-09-09
### Fixed
- Swedish å/ä/ö/Å/Ä/Ö rendered as garbled characters (or vanished entirely) in every PDF export - race results, start lists, heat sheets, team reports and the results archive - because the PDF's font never declared a character encoding and its text was written as UTF-8 instead of the single-byte encoding a PDF font actually expects. Both are now fixed at the shared PDF renderer, so every export is corrected at once.
## 1.7.0 - 2026-09-09
### Added