Fix: hx-download prefers ASCII filename= over UTF-8 filename*

Issue #4020 · PR #4043 · Base: 7f9160f0 (four-dev)

Before Fix

upstream/four-dev @ 7f9160f0

The first filename= token wins, so the UTF-8 filename* is ignored.

Click Download…

After Fix

7f9160f0 + fix

RFC 5987 filename* is preferred. Saved name is Réconciliation Inv privés.xlsx.

Click Download…

Mock fetch() returns a dual Content-Disposition header. No file is written — the demo intercepts the generated <a download> filename.

- /filename\*?=['"]?(?:UTF-8'')?([^'";]+)/i
+ filename* first, then filename=