From 92f8cdc50c14648711cb7169dfa4c0aaab82d96b Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 7 Oct 2026 21:00:42 +0200 Subject: [PATCH] Reminder: a fold that would cut a character, tested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A name whose ñ falls on the 75th octet of the SUMMARY line: the line folds before it, at 74, and the continuation starts with the ñ. The TypeScript port of the reminder needed this case to cover the step back of the fold; Go has it too. Co-Authored-By: Claude Opus 5.5 --- cmd/datekeys/reminder_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/datekeys/reminder_test.go b/cmd/datekeys/reminder_test.go index e7161b4..a85071d 100644 --- a/cmd/datekeys/reminder_test.go +++ b/cmd/datekeys/reminder_test.go @@ -57,6 +57,12 @@ func TestReminderICS(t *testing.T) { t.Errorf("a line of %d octets: %q", len(line), line) } } + // SUMMARY and the start of the text take 49 octets: with 25 more, ñ takes + // octets 75 and 76, and the line folds before it, at 74. + r.Name = strings.Repeat("x", 25) + "ñ.dkc" + if want := "SUMMARY:Ya se puede abrir la cápsula DateKeys «" + strings.Repeat("x", 25) + "\r\n ñ.dkc»\r\n"; !strings.Contains(r.ics(), want) { + t.Errorf("a fold that would cut ñ:\n%s", r.ics()) + } if id, err := newUID(); err != nil || len(id) != 36 || id[14] != '4' || !strings.ContainsRune("89ab", rune(id[19])) { t.Errorf("a UUID of version 4: %q, %v", id, err) }