fix: update CSV import to correctly decode Windows-1252 encoding for venue names
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 51s

This commit is contained in:
Torsten Schulz (local)
2026-07-17 12:00:17 +02:00
parent 5357dac9e1
commit 94385231d3

View File

@@ -72,9 +72,12 @@ class MatchService {
async importCSV(userToken, clubId, filePath) {
await checkAccess(userToken, clubId);
let seasonString = '';
const matches = [];
try {
const fileStream = fs.createReadStream(filePath)
.pipe(iconv.decodeStream('utf8'))
// click-TT exports this file as Windows-1252 / ISO-8859-1.
// Decoding it as UTF-8 corrupts umlauts in venue names and addresses.
.pipe(iconv.decodeStream('win1252'))
.pipe(csv({ separator: ';' }));
for await (const row of fileStream) {
const parsedDate = parse(row['Termin'], 'dd.MM.yyyy HH:mm', new Date());