diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:50 +0000 |
commit | fe39ffb8b90ae4e002ed73fe98617cd590abb467 (patch) | |
tree | b80e5956907d8aeaaffe4e4f0c068c0e6157ce8b /docs/manual/mod/mod_xml2enc.html | |
parent | Initial commit. (diff) | |
download | apache2-upstream/2.4.56.tar.xz apache2-upstream/2.4.56.zip |
Adding upstream version 2.4.56.upstream/2.4.56
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | docs/manual/mod/mod_xml2enc.html | 9 | ||||
-rw-r--r-- | docs/manual/mod/mod_xml2enc.html.en | 219 | ||||
-rw-r--r-- | docs/manual/mod/mod_xml2enc.html.fr.utf8 | 239 |
3 files changed, 467 insertions, 0 deletions
diff --git a/docs/manual/mod/mod_xml2enc.html b/docs/manual/mod/mod_xml2enc.html new file mode 100644 index 0000000..f810b6c --- /dev/null +++ b/docs/manual/mod/mod_xml2enc.html @@ -0,0 +1,9 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: mod_xml2enc.html.en +Content-Language: en +Content-type: text/html; charset=UTF-8 + +URI: mod_xml2enc.html.fr.utf8 +Content-Language: fr +Content-type: text/html; charset=UTF-8 diff --git a/docs/manual/mod/mod_xml2enc.html.en b/docs/manual/mod/mod_xml2enc.html.en new file mode 100644 index 0000000..a76bb66 --- /dev/null +++ b/docs/manual/mod/mod_xml2enc.html.en @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_xml2enc - Apache HTTP Server Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Apache Module mod_xml2enc</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_xml2enc.html" title="English"> en </a> | +<a href="../fr/mod/mod_xml2enc.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Enhanced charset/internationalisation support for libxml2-based +filter modules</td></tr> +<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>xml2enc_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_xml2enc.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.4 and later. Available as a third-party module +for 2.2.x versions</td></tr></table> +<h3>Summary</h3> + + <p>This module provides enhanced internationalisation support for + markup-aware filter modules such as <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code>. + It can automatically detect the encoding of input data and ensure + they are correctly processed by the <a href="http://xmlsoft.org/">libxml2</a> parser, including converting to Unicode (UTF-8) where + necessary. It can also convert data to an encoding of choice + after markup processing, and will ensure the correct <var>charset</var> + value is set in the HTTP <var>Content-Type</var> header.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Topics</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#usage">Usage</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#api">Programming API</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#sniffing">Detecting an Encoding</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#output">Output Encoding</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#alias">Unsupported Encodings</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2encalias">xml2EncAlias</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2encdefault">xml2EncDefault</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2startparse">xml2StartParse</a></li> +</ul> +<h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_xml2enc">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_xml2enc">Report a bug</a></li></ul><h3>See also</h3> +<ul class="seealso"> +<li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="usage" id="usage">Usage</a></h2> + <p>There are two usage scenarios: with modules programmed to work + with mod_xml2enc, and with those that are not aware of it:</p> + <dl> + <dt>Filter modules enabled for mod_xml2enc</dt><dd> + <p>Modules such as <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code> version 3.1 + and up use the <code>xml2enc_charset</code> optional function to retrieve + the charset argument to pass to the libxml2 parser, and may use the + <code>xml2enc_filter</code> optional function to postprocess to another + encoding. Using mod_xml2enc with an enabled module, no configuration + is necessary: the other module will configure mod_xml2enc for you + (though you may still want to customise it using the configuration + directives below).</p> + </dd> + <dt>Non-enabled modules</dt><dd> + <p>To use it with a libxml2-based module that isn't explicitly enabled for + mod_xml2enc, you will have to configure the filter chain yourself. So to + use it with a filter <strong>foo</strong> provided by a module + <strong>mod_foo</strong> to improve the latter's i18n support with HTML and + XML, you could use</p> + <pre><code> + FilterProvider iconv xml2enc Content-Type $text/html + FilterProvider iconv xml2enc Content-Type $xml + FilterProvider markup foo Content-Type $text/html + FilterProvider markup foo Content-Type $xml + FilterChain iconv markup + </code></pre> + <p><strong>mod_foo</strong> will now support any character set supported by either + (or both) of libxml2 or apr_xlate/iconv.</p> + </dd></dl> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="api" id="api">Programming API</a></h2> + <p>Programmers writing libxml2-based filter modules are encouraged to + enable them for mod_xml2enc, to provide strong i18n support for your + users without reinventing the wheel. The programming API is exposed in + <var>mod_xml2enc.h</var>, and a usage example is + <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code>.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="sniffing" id="sniffing">Detecting an Encoding</a></h2> + <p>Unlike <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>, mod_xml2enc is designed + to work with data whose encoding cannot be known in advance and thus + configured. It therefore uses 'sniffing' techniques to detect the + encoding of HTTP data as follows:</p> + <ol> + <li>If the HTTP <var>Content-Type</var> header includes a + <var>charset</var> parameter, that is used.</li> + <li>If the data start with an XML Byte Order Mark (BOM) or an + XML encoding declaration, that is used.</li> + <li>If an encoding is declared in an HTML <code><META></code> + element, that is used.</li> + <li>If none of the above match, the default value set by + <code class="directive">xml2EncDefault</code> is used.</li> + </ol> + <p>The rules are applied in order. As soon as a match is found, + it is used and detection is stopped.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="output" id="output">Output Encoding</a></h2> +<p><a href="http://xmlsoft.org/">libxml2</a> always uses UTF-8 (Unicode) +internally, and libxml2-based filter modules will output that by default. +mod_xml2enc can change the output encoding through the API, but there +is currently no way to configure that directly.</p> +<p>Changing the output encoding should (in theory, at least) never be +necessary, and is not recommended due to the extra processing load on +the server of an unnecessary conversion.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="alias" id="alias">Unsupported Encodings</a></h2> +<p>If you are working with encodings that are not supported by any of +the conversion methods available on your platform, you can still alias +them to a supported encoding using <code class="directive">xml2EncAlias</code>.</p> +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2EncAlias" id="xml2EncAlias">xml2EncAlias</a> <a name="xml2encalias" id="xml2encalias">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Recognise Aliases for encoding values</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>xml2EncAlias <var>charset alias [alias ...]</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>This server-wide directive aliases one or more encoding to another + encoding. This enables encodings not recognised by libxml2 to be handled + internally by libxml2's encoding support using the translation table for + a recognised encoding. This serves two purposes: to support character sets + (or names) not recognised either by libxml2 or iconv, and to skip + conversion for an encoding where it is known to be unnecessary.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2EncDefault" id="xml2EncDefault">xml2EncDefault</a> <a name="xml2encdefault" id="xml2encdefault">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets a default encoding to assume when absolutely no information +can be <a href="#sniffing">automatically detected</a></td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>xml2EncDefault <var>name</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>If you are processing data with known encoding but no encoding + information, you can set this default to help mod_xml2enc process + the data correctly. For example, to work with the default value + of Latin1 (<var>iso-8859-1</var>) specified in HTTP/1.0, use:</p> + <pre class="prettyprint lang-config">xml2EncDefault iso-8859-1</pre> + + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2StartParse" id="xml2StartParse">xml2StartParse</a> <a name="xml2startparse" id="xml2startparse">Directive</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Advise the parser to skip leading junk.</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>xml2StartParse <var>element [element ...]</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> +<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>Specify that the markup parser should start at the first instance + of any of the elements specified. This can be used as a workaround + where a broken backend inserts leading junk that messes up the parser (<a href="http://bahumbug.wordpress.com/2006/10/12/mod_proxy_html-revisited/">example here</a>).</p> + <p>It should never be used for XML, nor well-formed HTML.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="../en/mod/mod_xml2enc.html" title="English"> en </a> | +<a href="../fr/mod/mod_xml2enc.html" hreflang="fr" rel="alternate" title="Français"> fr </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_xml2enc.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/mod/mod_xml2enc.html.fr.utf8 b/docs/manual/mod/mod_xml2enc.html.fr.utf8 new file mode 100644 index 0000000..bcab35f --- /dev/null +++ b/docs/manual/mod/mod_xml2enc.html.fr.utf8 @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>mod_xml2enc - Serveur HTTP Apache Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body> +<div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p> +<p class="apache">Serveur HTTP Apache Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Serveur HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> +<div id="page-content"> +<div id="preamble"><h1>Module Apache mod_xml2enc</h1> +<div class="toplang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_xml2enc.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_xml2enc.html" title="Français"> fr </a></p> +</div> +<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Support avancé de l'internationalisation et des jeux de +caractères pour les modules de filtrage basés sur libxml2</td></tr> +<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Base</td></tr> +<tr><th><a href="module-dict.html#ModuleIdentifier">Identificateur de Module:</a></th><td>xml2enc_module</td></tr> +<tr><th><a href="module-dict.html#SourceFile">Fichier Source:</a></th><td>mod_xml2enc.c</td></tr> +<tr><th><a href="module-dict.html#Compatibility">Compatibilité:</a></th><td>Disponible depuis la version 2.4 du serveur HTTP Apache. +Disponible en tant que module tiers dans les versions 2.2.x</td></tr></table> +<h3>Sommaire</h3> + + <p>Ce module fournit un support avancé de l'internationalisation + pour les modules de filtrage supportant les balises (markup-aware) + comme <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code>. Il est capable de détecter + automatiquement l'encodage des données en entrée et de s'assurer + qu'elle sont traitées correctement par l'interpréteur <a href="http://xmlsoft.org/">libxml2</a>, y compris la conversion en + Unicode (UTF-8) si nécessaire. Il peut aussi convertir les données + dans l'encodage de votre choix après le traitement des balises, et + s'assurera que le <var>jeu de caractères</var> approprié sera défini + dans l'en-tête HTTP <var>Content-Type</var>.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3>Sujets</h3> +<ul id="topics"> +<li><img alt="" src="../images/down.gif" /> <a href="#usage">Utilisation</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#api">API de programmation</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#sniffing">Détection et encodage</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#output">Codage en sortie</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#alias">Codages non supportés</a></li> +</ul><h3 class="directives">Directives</h3> +<ul id="toc"> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2encalias">xml2EncAlias</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2encdefault">xml2EncDefault</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#xml2startparse">xml2StartParse</a></li> +</ul> +<h3>Traitement des bugs</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">Journal des modifications de httpd</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&list_id=144532&product=Apache%20httpd-2&query_format=specific&order=changeddate%20DESC%2Cpriority%2Cbug_severity&component=mod_xml2enc">Problèmes connus</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&component=mod_xml2enc">Signaler un bug</a></li></ul><h3>Voir aussi</h3> +<ul class="seealso"> +<li><a href="#comments_section">Commentaires</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="usage" id="usage">Utilisation</a></h2> + <p>Il existe deux scénarios d'utilisation : le cas des modules + programmés pour travailler avec mod_xml2enc ; et les autres :</p> + <dl> + <dt>Modules de filtrages programmés pour mod_xml2enc</dt><dd> + <p>Les modules comme <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code> versions 3.1 et + supérieures utilisent la fonction optionnelle + <code>xml2enc_charset</code> pour déterminer la valeur de l'argument + "jeu de caractères" à transmettre à l'interpréteur libxml2, et + disposent de la fonction optionnelle <code>xml2enc_filter</code> + pour effectuer un encodage ultérieur éventuel. L'utilisation de + mod_xml2enc avec un module préprogrammé à cet effet ne nécessite + aucune configuration : ce dernier configurera mod_xml2enc pour vous + (sachant que vous pouvez tout de même le personnaliser via les + directives de configuration ci-dessous).</p> + </dd> + <dt>Modules de filtrages non programmés pour mod_xml2enc</dt><dd> + <p>Pour utiliser mod_xml2enc avec un module basé sur libxml2 qui n'a + pas été explicitement programmé pour mod_xml2enc, vous devrez + configurer la chaîne de filtrage vous-même. Ainsi, pour utiliser + mod_xml2enc avec un filtre <strong>foo</strong> fourni par un module + <strong>mod_foo</strong> et pour + améliorer le support i18n de ce dernier avec HTML et XML, vous + pouvez utiliser les directives suivantes :</p> + <pre><code> + FilterProvider iconv xml2enc Content-Type $text/html + FilterProvider iconv xml2enc Content-Type $xml + FilterProvider markup foo Content-Type $text/html + FilterProvider markup foo Content-Type $xml + FilterChain iconv markup + </code></pre> + <p><strong>mod_foo</strong> supportera alors tout jeu de caractère supporté soit par + libxml2, soit par apr_xlate/iconv, soit par les deux.</p> + </dd></dl> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="api" id="api">API de programmation</a></h2> + <p>Les programmeurs de modules de filtrage basés sur libxml2 sont + encouragés à les préprogrammer pour mod_xml2enc, afin de fournir un + support i18n solide aux utilisateurs sans avoir à réinventer la + roue. L'API de programmation est décrite dans + <var>mod_xml2enc.h</var>, et <code class="module"><a href="../mod/mod_proxy_html.html">mod_proxy_html</a></code> est un + exemple de son utilisation.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="sniffing" id="sniffing">Détection et encodage</a></h2> + <p>A la différence de <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>, mod_xml2enc + est conçu pour travailler avec des données dont l'encodage ne peut + pas être connu, et donc configuré, à l'avance. Il utilise donc les + techniques de 'reniflage' suivantes pour détecter le type d'encodage + des données HTTP :</p> + <ol> + <li>Si l'en-tête HTTP <var>Content-Type</var> contient un + paramètre <var>charset</var>, c'est ce dernier qui sera utilisé.</li> + <li>Si les données commancent par une balise XML concernant + l'ordre des octets (BOM) ou par une déclaration d'encodage XML, + c'est celle-ci qui sera utilisée.</li> + <li>Si un type d'encodage est déclaré dans un élément HTML + <code><META></code>, c'est ce dernier qui sera utilisé.</li> + <li>Si aucun des éléments précédents n'est trouvé, c'est la + valeur par défaut définie par la directive + <code class="directive">xml2EncDefault</code> qui sera utilisée.</li> + </ol> + <p>Les conditions sont testées dans cet ordre . Dès qu'une règle + s'applique, elle est utilisée et la détection est terminée.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="output" id="output">Codage en sortie</a></h2> +<p><a href="http://xmlsoft.org/">libxml2</a> utilise toujours UTF-8 +(Unicode) en interne, et les modules de filtrage basés sur libxml2 +utiliseront cet encodage en sortie par défaut. mod_xml2enc peut modifier +l'encodage en sortie via l'API, mais il n'y a actuellement aucun moyen de le +configurer directement.</p> +<p>La modification de l'encodage en sortie ne devrait (du moins en théorie) +jamais être nécessaire, et est même déconseillée à cause de la charge de +traitement supplémentaire imposée au serveur par une conversion non +nécessaire.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="alias" id="alias">Codages non supportés</a></h2> +<p>Si vous travaillez avec des encodages non supportés par aucune des +méthodes de conversion disponibles sur votre plateforme, vous pouvez +tout de même leur associer un alias vers un code supporté via la +directive <code class="directive">xml2EncAlias</code>.</p> +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2encalias" id="xml2encalias">Directive</a> <a name="xml2EncAlias" id="xml2EncAlias">xml2EncAlias</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Définit des alias pour les valeurs d'encodage</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>xml2EncAlias <var>jeu-de-caractères alias [alias ...]</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>Cette directive de niveau serveur permet de définir un ou + plusieurs alias pour un encodage. Elle permet au support d'encodage de + libxml2 de traiter en interne des encodages non reconnus par libxml2 + en utilisant la table de conversion pour un encodage reconnu. Elle + permet d'atteindre deux objectifs : supporter des jeux (ou noms) de + caractères non reconnus par libxml2 ou iconv, et éviter une + conversion pour un encodage lorsque cela n'est pas nécessaire.</p> + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2encdefault" id="xml2encdefault">Directive</a> <a name="xml2EncDefault" id="xml2EncDefault">xml2EncDefault</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Définit un encodage par défaut à utiliser lorsqu'aucune +information ne peut être <a href="#sniffing">automatiquement détectée</a></td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>xml2EncDefault <var>nom</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel, répertoire, .htaccess</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>Si vous traitez des données dont l'encodage est connu, mais ne + contenant aucune information à propos de ce dernier, vous pouvez + définir une valeur par défaut afin d'aider mod_xml2enc à traiter + correctement les données. Par exemple, pour définir la valeur par + défaut Latin1 (<var>iso-8859-1</var>) specifiée dans HTTP/1.0, + utilisez :</p> + <pre class="prettyprint lang-config">xml2EncDefault iso-8859-1</pre> + + +</div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="directive-section"><h2><a name="xml2startparse" id="xml2startparse">Directive</a> <a name="xml2StartParse" id="xml2StartParse">xml2StartParse</a></h2> +<table class="directive"> +<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Indique à l'interpréteur à partir de quelle balise il doit +commencer son traitement.</td></tr> +<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>xml2StartParse <var>élément [élément ...]</var></code></td></tr> +<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel, répertoire, .htaccess</td></tr> +<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Base</td></tr> +<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_xml2enc</td></tr> +</table> + <p>Cette directive permet de spécifier à partir de quelle balise, + parmi les éléments spécifiés, l'interpréteur de balise doit + commencer son traitement. Ccei permet de contourner le problème des + serveurs d'arrière-plan qui insèrent des éléments non conformes en + début de données, ce qui a pour effet de perturber l'interpréteur (<a href="http://bahumbug.wordpress.com/2006/10/12/mod_proxy_html-revisited/">voir un exemple ici</a>).</p> + <p>Elle ne doit être utilisée ni pour les documents XML, ni pour les + documents HTML correctement formatés.</p> + +</div> +</div> +<div class="bottomlang"> +<p><span>Langues Disponibles: </span><a href="../en/mod/mod_xml2enc.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../fr/mod/mod_xml2enc.html" title="Français"> fr </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our <a href="https://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_xml2enc.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2023 The Apache Software Foundation.<br />Autorisé sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file |