Ed Korthof wrote:
> Hi --
>
> The Header directive in mod_headers.c doesn't allow for embedded
> percentage characters (%). This can be useful for writing out values
> encoded via MIME semantics: some MIME headers allow a character set
> indicator -- RFC 2184 allows this in the Content-disposition header, for
> the filename, to indicate the encoding of the bytes in the name.
>
> The example that I have working (at least for IE ... Mozilla ignores the
> relevant header, sadly) uses percentage characters to encode the data in
> the filename -- this seems to be the safest approach when the characters
> may be in an encoding other than what the client expects. This produces
> headers more or less like the following:
>
> Content-disposition: attachment;
filename*=utf-8'ja'%e7%a7%81%e3%81%ae%e3%83%86%e3%82%b9%e3%83%88%e8%a1%a8%e7%a4%\
ba.txt
>
> (wrapping seems to be optional)
>
> Anyway, I had to modify mod_headers.c to allow that behavior. The
> attached patch allows percentage characters to be included in Header
> constant string values by doubling them up. I reused an existing
> function -- constant_item -- because that seems more or less consistent
> with the design (it looks like all the tag formatting functions are
> treated the same); and it works, at least in 2.0.45. I didn't update
> the generated .html.en doc for this -- just the .xml doc.
>
> thanks --
>
> Ed
>
>
> ------------------------------------------------------------------------
>
> Index: docs/manual/mod/mod_headers.xml
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/docs/manual/mod/mod_headers.xml,v
> retrieving revision 1.6
> diff -u -r1.6 mod_headers.xml
> --- docs/manual/mod/mod_headers.xml 11 Apr 2003 01:25:52 -0000 1.6
> +++ docs/manual/mod/mod_headers.xml 7 May 2003 19:01:27 -0000
> @@ -244,6 +244,10 @@
> <tr><td><code>%{FOOBAR}e</code></td>
> <td>The contents of the <a href="../env.html">environment
> variable</a> <code>FOOBAR</code>.</td></tr>
> +
> + <tr><td><code>%%</code></td>
> + <td>This syntax can be used to include a percentage sign (%) as
> + in a litteral character string.</td></tr>
litteral -> literal
+1 on the patch.
bill