You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add RFC 5987/6266 UTF-8 filename support in Content-Disposition header #7
The SpreadsheetResponse class currently relies on Symfony's HeaderUtils::makeDisposition() for setting the Content-Disposition header. However, it would be beneficial to ensure that UTF-8 filenames with special characters (like accents) are properly supported using RFC 5987/6266.
Current Behavior
When a filename contains accents or special characters (e.g., "Liste des utilisateurs avec données.xlsx"), it may not be handled correctly by all browsers.
Expected Behavior
The Content-Disposition header should include both:
filename="ascii-fallback.xlsx" - ASCII filename for older browsers
filename*=UTF-8''utf8-filename.xlsx" - UTF-8 encoded filename for modern browsers
Example:
Content-Disposition: attachment; filename="Liste des utilisateurs avec donnees.xlsx"; filename*=UTF-8''Liste%20des%20utilisateurs%20avec%20donn%C3%A9es.xlsx
Proposed Solution
Verify that Symfony's HeaderUtils::makeDisposition() is being used correctly with UTF-8 filenames, or implement custom handling if needed to ensure RFC 5987/6266 compliance.
Context
This issue was identified while implementing UTF-8 filename support in a project using this library. The legacy download mechanism was updated to support RFC 5987/6266, and it would be good to ensure the modern SpreadsheetResponse approach also handles this correctly.
After investigating the current implementation, I found that RFC 5987/6266 UTF-8 filename support is already working correctly through Symfony's HeaderUtils::makeDisposition().
When a filename contains non-ASCII characters, the Content-Disposition header correctly includes both formats:
filename="ascii-fallback.xlsx" - ASCII fallback for older browsers
filename*=utf-8''encoded.xlsx - UTF-8 encoded filename for modern browsers
For example, with Liste des utilisateurs avec données.xlsx, the header generates:
Activity
Add tests for RFC 5987/6266 UTF-8 filename support
joanfabregat commentedon Jan 23, 2026
Investigation & Resolution
After investigating the current implementation, I found that RFC 5987/6266 UTF-8 filename support is already working correctly through Symfony's
HeaderUtils::makeDisposition().When a filename contains non-ASCII characters, the
Content-Dispositionheader correctly includes both formats:filename="ascii-fallback.xlsx"- ASCII fallback for older browsersfilename*=utf-8''encoded.xlsx- UTF-8 encoded filename for modern browsersFor example, with
Liste des utilisateurs avec données.xlsx, the header generates:What was added in PR #8:
No changes to the main
SpreadsheetResponseclass were needed - the implementation was already correct.