From 6a45d8c7e9f66d04cf4916264da135def5c0549d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 19:31:51 -1000 Subject: Add filename* for a download name past ASCII MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plain, snapshot and blob pages sent a name such as café.txt raw in filename, which a client may read as ISO-8859-1. RFC 6266 has such a name sent again as filename*, percent-encoded in UTF-8, for a client that knows the form, with filename first for one that does not. The extended form carries UTF-8 alone, so a name that is not valid UTF-8 keeps the plain filename by itself. --- source/html.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/html.h') diff --git a/source/html.h b/source/html.h index 4c16f85..1accb37 100644 --- a/source/html.h +++ b/source/html.h @@ -93,6 +93,13 @@ extern void html_attr_url(const char *txt); extern void html_url_arg(const char *txt); extern void html_header_arg_in_quotes(const char *txt); + +/* + * Percent-encode txt as the value of an RFC 8187 header parameter such as + * filename*, leaving out the charset and language the value opens with. + */ +extern void html_header_ext_value(const char *txt); + extern void html_header_query(const char *txt); extern void html_hidden(const char *name, const char *value); -- cgit 2.12.1