@@ -139,8 +139,8 @@ available</description>
139139
140140<directivesynopsis >
141141<name >AddDefaultCharset</name >
142- <description >Default character set to be added for a
143- response without an explicit character set </description >
142+ <description >Default charset parameter to be added when a response
143+ content-type is "text/plain" or "text/html" </description >
144144<syntax >AddDefaultCharset On|Off|<var >charset</var ></syntax >
145145<default >AddDefaultCharset Off</default >
146146<contextlist ><context >server config</context >
@@ -149,21 +149,36 @@ response without an explicit character set</description>
149149<override >FileInfo</override >
150150
151151<usage >
152- <p >This directive specifies the name of the character set that
153- will be added to any response that does not have any parameter on
154- the content type in the HTTP headers. This will override any
155- character set specified in the body of the document via a
156- <code >META</code > tag. A setting of <code >AddDefaultCharset
157- Off</code > disables this
158- functionality. <code >AddDefaultCharset On</code > enables
159- Apache's internal default charset of <code >iso-8859-1</code > as
160- required by the directive. You can also specify an alternate
161- <var >charset</var > to be used. For example:</p >
152+ <p >This directive specifies a default value for the media type
153+ charset parameter (the name of a character encoding) to be added
154+ to a response if and only if the response's content-type is either
155+ "text/plain" or "text/html". This should override any charset
156+ specified in the body of the document via a <code >META</code > tag,
157+ though the exact behavior is often dependent on the user's client
158+ configuration. A setting of <code >AddDefaultCharset Off</code >
159+ disables this functionality. <code >AddDefaultCharset On</code > enables
160+ a default charset of <code >iso-8859-1</code >. Any other value is assumed
161+ to be the <var >charset</var > to be used, which should be one of the
162+ <a href =" http://www.iana.org/assignments/character-sets" >IANA registered
163+ charset values</a > for use in MIME media types.
164+ For example:</p >
162165
163166 <example >
164167 AddDefaultCharset utf-8
165168 </example >
169+
170+ <p ><code >AddDefaultCharset</code > should only be used when all
171+ of the text resources to which it applies are known to be in that
172+ character encoding and it is too inconvenient to label their charset
173+ individually. One such example is to add the charset parameter
174+ to resources containing generated content, such as legacy CGI
175+ scripts, that might be vulnerable to cross-site scripting attacks
176+ due to user-provided data being included in the output. Note, however,
177+ that a better solution is to just fix (or delete) those scripts, since
178+ setting a default charset does not protect users that have enabled
179+ the "auto-detect character encoding" feature on their browser.</p >
166180</usage >
181+ <seealso ><directive module =" mod_mime" >AddCharset</directive ></seealso >
167182</directivesynopsis >
168183
169184<directivesynopsis >
0 commit comments