Author: buildbot
Date: Wed Dec 11 00:03:36 2013
New Revision: 889914

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    
websites/staging/sling/trunk/content/documentation/the-sling-engine/request-parameters.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Dec 11 00:03:36 2013
@@ -1 +1 @@
-1549375
+1550003

Modified: 
websites/staging/sling/trunk/content/documentation/the-sling-engine/request-parameters.html
==============================================================================
--- 
websites/staging/sling/trunk/content/documentation/the-sling-engine/request-parameters.html
 (original)
+++ 
websites/staging/sling/trunk/content/documentation/the-sling-engine/request-parameters.html
 Wed Dec 11 00:03:36 2013
@@ -175,21 +175,21 @@
 <h2 id="character-encoding">Character Encoding</h2>
 <p>Traditionally, the encoding of parameters, especially in text area input 
forms, has been a big issue. To solve this issue Sling introduces the following 
convention:</p>
 <ul>
-<li>All forms should contain a hidden field of the name 
<code>\*charset\*</code> containing the actual encoding used to send the form 
from the server to the client</li>
+<li>All forms should contain a hidden field of the name 
<code><em>charset</em></code> containing the actual encoding used to send the 
form from the server to the client</li>
 <li>All forms should be sent with <em>UTF-8</em> character encoding</li>
 </ul>
 <p>The first rule is essential as it helps decoding the form input correctly. 
The second rule is not actually a very hard requirement but to enable support 
for all (or most) character sets used, using <em>UTF-8</em> is one of the best 
choices anyway.</p>
-<p>When Sling is now receiving a request and is asked for the parameters, the 
parameters are parsed in two phases: The first phase just parses the raw input 
data using an identity transformation of bytes to characters. This identity 
transformation happens to generate strings as the original data was generated 
with <code>ISO-8859-1</code> encoding. The second phase locates the 
<code>\*charset\*</code> parameter and fixes the character encodings of the 
parameters as follows:</p>
+<p>When Sling is now receiving a request and is asked for the parameters, the 
parameters are parsed in two phases: The first phase just parses the raw input 
data using an identity transformation of bytes to characters. This identity 
transformation happens to generate strings as the original data was generated 
with <code>ISO-8859-1</code> encoding. The second phase locates the 
<code><em>charset</em></code> parameter and fixes the character encodings of 
the parameters as follows:</p>
 <ul>
 <li>All names of the parameters are re-encoded</li>
-<li>The parameter values are re-encoded, unless the parameter value is an 
uploaded file. Actually the parameter (not the files of course) are internally 
as <code>byte[]()</code> where the conversion to a string is done on the fly 
(and yes, the conversion using the <code>\*charset\*</code> character encoding 
is of course cached for performance reasons)</li>
+<li>The parameter values are re-encoded, unless the parameter value is an 
uploaded file. Actually the parameter (not the files of course) are internally 
as <code>byte[]()</code> where the conversion to a string is done on the fly 
(and yes, the conversion using the <code><em>charset</em></code> character 
encoding is of course cached for performance reasons)</li>
 <li>If the parameter is an uploaded file, the file name is re-encoded on the 
fly when accessed</li>
 </ul>
 <div class="info">
 Up to and including Sling Engine 2.2.2 request parameters are always decoded 
with ISO-8859-1 encoding if the <code>_charset_</code> request parameter is 
missing. As of Sling Engine 2.2.4 the <code>_charset_</code> request parameter 
is optional. As of this version the Sling Main Servlet supports a configuration 
setting which allows to change the default character encoding used if the 
<code>_charset_</code> request parameter is missing. To enable this 
functionality set the <code>sling.default.parameter.encoding</code> parameter 
of the Sling Main Servlet (PID 
<code>org.apache.sling.engine.impl.SlingMainServlet</code>) configuration to 
the desired encoding, which of course must be supported by the actual Java 
Platform.
 </div>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; 
text-align: right;">
-        Rev. 1500501 by fmeschbe on Sun, 7 Jul 2013 18:49:51 +0000
+        Rev. 1550003 by cziegeler on Wed, 11 Dec 2013 00:03:16 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache 
Sling project


Reply via email to