[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/_appendices/ini.core.xml_appendices/migration56/new-featur
From: Adam_Harvey <aharvey () php ! net>
Date: 2014-08-28 3:36:23
Message-ID: svn-aharvey-1409196983-334627-1349847687 () svn ! php ! net
[Download RAW message or body]
aharvey Thu, 28 Aug 2014 03:36:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=334627
Log:
Improve documentation for default_charset in PHP 5.6.
Changed paths:
U phpdoc/en/trunk/appendices/ini.core.xml
U phpdoc/en/trunk/appendices/migration56/new-features.xml
U phpdoc/en/trunk/language-snippets.ent
U phpdoc/en/trunk/reference/strings/functions/html-entity-decode.xml
U phpdoc/en/trunk/reference/strings/functions/htmlentities.xml
U phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml
["svn-diffs-334627.txt" (text/x-diff)]
Modified: phpdoc/en/trunk/appendices/ini.core.xml
===================================================================
--- phpdoc/en/trunk/appendices/ini.core.xml 2014-08-28 03:05:02 UTC (rev 334626)
+++ phpdoc/en/trunk/appendices/ini.core.xml 2014-08-28 03:36:23 UTC (rev 334627)
@@ -731,7 +731,7 @@
<entry><link linkend="ini.default-charset">default_charset</link></entry>
<entry>"UTF-8"</entry>
<entry>PHP_INI_ALL</entry>
- <entry>Default to "UTF-8" since PHP >= 5.6.0, empty for PHP < \
5.6.0.</entry> + <entry>Defaults to "UTF-8" since PHP >= 5.6.0; empty for \
PHP < 5.6.0.</entry> </row>
<row>
<entry><link \
linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link></entry>
@@ -1126,11 +1126,32 @@
</term>
<listitem>
<para>
- Since PHP 5.6.0, "UTF-8" is the default and its value is used as PHP
- default character encoding for modules/functions. PHP always outputs
- a character encoding by default in the Content-type: header. Setting
- empty value is not recommended.
+ In PHP 5.6 onwards, "UTF-8" is the default value and its value is used
+ as the default character encoding for
+ <function>htmlentities</function>,
+ <function>html_entity_decode</function> and
+ <function>htmlspecialchars</function> if the
+ <parameter>encoding</parameter> parameter is omitted. The value of
+ <parameter>default_charset</parameter> will also be used to set the
+ default character set for <link linkend="book.iconv">iconv</link>
+ functions if the
+ <link linkend="ini.iconv.input-encoding"><parameter>iconv.input_encoding</parameter></link>,
+ <link linkend="ini.iconv.output-encoding"><parameter>iconv.output_encoding</parameter></link> \
and + <link linkend="ini.iconv.internal-encoding"><parameter>iconv.internal_encoding</parameter></link>
+ configuration options are unset, and for
+ <link linkend="book.mbstring">mbstring</link> functions if the
+ <link linkend="ini.mbstring.internal-encoding"><parameter>mbstring.internal_encoding</parameter></link>
+ configuration option is unset.
</para>
+ <para>
+ All versions of PHP will use this value as the charset within the
+ default Content-Type header sent by PHP if the header isn't overridden
+ by a call to <function>header</function>.
+ </para>
+ <para>
+ Setting <parameter>default_charset</parameter> to an empty value is
+ not recommended.
+ </para>
</listitem>
</varlistentry>
Modified: phpdoc/en/trunk/appendices/migration56/new-features.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration56/new-features.xml 2014-08-28 03:05:02 UTC \
(rev 334626)
+++ phpdoc/en/trunk/appendices/migration56/new-features.xml 2014-08-28 03:36:23 UTC \
(rev 334627) @@ -208,10 +208,12 @@
<para>
<link linkend="ini.default-charset">default_charset</link> is now used as
- the default character set for functions that are encoding-specific, such
- as <function>htmlspecialchars</function>. Note that if the (now
+ the default character set for the <function>htmlentities</function>,
+ <function>html_entity_decode</function> and
+ <function>htmlspecialchars</function> functions. Note that if the (now
deprecated) iconv and mbstring encoding settings are set, they will take
- precedence over default_charset.
+ precedence over default_charset for iconv and mbstring functions,
+ respectively.
</para>
<para>
Modified: phpdoc/en/trunk/language-snippets.ent
===================================================================
--- phpdoc/en/trunk/language-snippets.ent 2014-08-28 03:05:02 UTC (rev 334626)
+++ phpdoc/en/trunk/language-snippets.ent 2014-08-28 03:36:23 UTC (rev 334627)
@@ -1784,6 +1784,41 @@
</listitem>
</varlistentry>'>
+<!-- strings snippets -->
+<!ENTITY strings.parameter.encoding '
+ <para xmlns="http://docbook.org/ns/docbook">
+ An optional argument defining the encoding used when converting characters.
+ </para>
+
+ <para xmlns="http://docbook.org/ns/docbook">
+ If omitted, the default value of the <parameter>encoding</parameter> varies
+ depending on the PHP version in use. In PHP 5.6 and later, the
+ <link linkend="ini.default-charset">default_charset</link> configuration
+ option is used as the default value. PHP 5.4 and 5.5 will use
+ <literal>UTF-8</literal> as the default. Earlier versions of PHP use
+ <literal>ISO-8859-1</literal>.
+ </para>
+
+ <para xmlns="http://docbook.org/ns/docbook">
+ Although this argument is technically optional, you are highly encouraged to
+ specify the correct value for your code if you are using PHP 5.5 or earlier,
+ or if your <link linkend="ini.default-charset">default_charset</link>
+ configuration option may be set incorrectly for the given input.
+ </para>
+'>
+
+<!ENTITY strings.changelog.encoding '
+ <row xmlns="http://docbook.org/ns/docbook">
+ <entry>5.6.0</entry>
+ <entry>
+ The default value for the <parameter>encoding</parameter> parameter was
+ changed to be the value of the
+ <link linkend="ini.default-charset">default_charset</link> configuration
+ option.
+ </entry>
+ </row>
+'>
+
<!-- Migration Guide snippets -->
<!ENTITY migration56.openssl.peer-verification '
<para xmlns="http://docbook.org/ns/docbook">
@@ -1814,3 +1849,24 @@
context option to &false;.
</para>
'>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: fen fdm=syntax fdl=2 si
+vim: et tw=78
+vi: ts=1 sw=1
+-->
Modified: phpdoc/en/trunk/reference/strings/functions/html-entity-decode.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/html-entity-decode.xml 2014-08-28 \
03:05:02 UTC (rev 334626)
+++ phpdoc/en/trunk/reference/strings/functions/html-entity-decode.xml 2014-08-28 \
03:36:23 UTC (rev 334627) @@ -12,7 +12,7 @@
<type>string</type><methodname>html_entity_decode</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ENT_COMPAT \
| ENT_HTML401</initializer></methodparam>
- <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>"UTF-8"</initializer></methodparam>
+ <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>ini_get("default_charset")</initializer></methodparam>
</methodsynopsis>
<para>
<function>html_entity_decode</function> is the opposite of
@@ -102,11 +102,7 @@
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
- <para>
- Encoding to use.
- If omitted, the default value for this argument is ISO-8859-1 in
- versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards.
- </para>
+ &strings.parameter.encoding;
&reference.strings.charsets;
</listitem>
</varlistentry>
@@ -133,6 +129,7 @@
</row>
</thead>
<tbody>
+ &strings.changelog.encoding;
<row>
<entry>5.4.0</entry>
<entry>
Modified: phpdoc/en/trunk/reference/strings/functions/htmlentities.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/htmlentities.xml 2014-08-28 03:05:02 \
UTC (rev 334626)
+++ phpdoc/en/trunk/reference/strings/functions/htmlentities.xml 2014-08-28 03:36:23 \
UTC (rev 334627) @@ -12,7 +12,7 @@
<type>string</type><methodname>htmlentities</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ENT_COMPAT \
| ENT_HTML401</initializer></methodparam>
- <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>"UTF-8"</initializer></methodparam>
+ <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>ini_get("default_charset")</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<para>
@@ -125,17 +125,7 @@
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
- <para>
- Like <function>htmlspecialchars</function>,
- <function>htmlentities</function> takes an optional third argument
- <parameter>encoding</parameter> which defines encoding used in
- conversion.
- From PHP 5.6.0, <link linkend="ini.default-charset">default_charset</link>
- value is used as default. From PHP 5.4.0, UTF-8 is the default.
- PHP prior to 5.4.0, ISO-8859-1 is used as the default.
- Although this argument is technically optional, you are highly
- encouraged to specify the correct value for your code.
- </para>
+ &strings.parameter.encoding;
&reference.strings.charsets;
</listitem>
</varlistentry>
@@ -177,6 +167,7 @@
</row>
</thead>
<tbody>
+ &strings.changelog.encoding;
<row>
<entry>5.4.0</entry>
<entry>
Modified: phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml 2014-08-28 \
03:05:02 UTC (rev 334626)
+++ phpdoc/en/trunk/reference/strings/functions/htmlspecialchars.xml 2014-08-28 \
03:36:23 UTC (rev 334627) @@ -12,7 +12,7 @@
<type>string</type><methodname>htmlspecialchars</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ENT_COMPAT \
| ENT_HTML401</initializer></methodparam>
- <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>"UTF-8"</initializer></methodparam>
+ <methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>ini_get("default_charset")</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter><initializer>true</initializer></methodparam>
</methodsynopsis>
<para>
@@ -166,14 +166,8 @@
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
+ &strings.parameter.encoding;
<para>
- From PHP 5.6.0, <link linkend="ini.default-charset">default_charset</link>
- value is used as default. From PHP 5.4.0, UTF-8 is the default.
- PHP prior to 5.4.0, ISO-8859-1 is used as the default.
- Although this argument is technically optional, you are highly
- encouraged to specify the correct value for your code.
- </para>
- <para>
For the purposes of this function, the encodings
<literal>ISO-8859-1</literal>, <literal>ISO-8859-15</literal>,
<literal>UTF-8</literal>, <literal>cp866</literal>,
@@ -224,6 +218,7 @@
</row>
</thead>
<tbody>
+ &strings.changelog.encoding;
<row>
<entry>5.4.0</entry>
<entry>
--
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic