# Encoding

In Abyss Web Server, the directives `#echo`, `#exec`, `#fsize`, `#flastmod`, and `#include` accept an optional argument `encoding`.

The value of this argument determines which conversion method is to be applied to the output of an XSSI directive. It can be:

- `none`: No conversion is performed and the output is transmitted without any modification.

- `entity`: The output is converted using the XML/HTML escaping: `<` is converted to `&lt;`, `>` to `&gt;`, `&` to `&amp;`, `"` to `&quot;`, and `'` to `&#39;`.

- `url`: All non-alphanumerical characters in the output except `-_.!~*'()/` are replaced with a percent sign `%` followed by two hexadecimal digits. This conversion conforms to the URL encoding scheme as described in RFC1738 and is useful to output well formed URLs.

- `reverse-url`: Sequences made of a percent sign `%` followed by two hexadecimal digits are decoded according to the URL encoding scheme.

If no `encoding` argument is present in `#echo`, `#fsize`, or `#flastmod` directives, the server will perform `entity` conversion.

If the `encoding` argument is present in `#exec` or `#include` directives, the server will perform no conversion of the output.

Example 7-2. Using the encoding argument in #include

       <HTML>
           <HEAD><TITLE>XSSI Test</TITLE></HEAD>
           <BODY>
                The HTML source code of page test.html is:
                <PRE><!-- #include file="test.html" encoding="entity" --></PRE>
           </BODY>
       </HTML>