mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@95982 c90b9560-bf6c-de11-be94-00142212c4b1
281 lines
8.1 KiB
XML
281 lines
8.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.4 $ -->
|
|
<section id="mbstring.configuration">
|
|
&reftitle.runtime;
|
|
&extension.runtime;
|
|
<para>
|
|
<table>
|
|
<title>Multi-Byte String configuration options</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Name</entry>
|
|
<entry>Default</entry>
|
|
<entry>Changeable</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>mbstring.language</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.detect_order</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.http_input</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.http_output</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.internal_encoding</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.script_encoding</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.substitute_character</entry>
|
|
<entry>NULL</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.func_overload</entry>
|
|
<entry>"0"</entry>
|
|
<entry>PHP_INI_SYSTEM</entry>
|
|
</row>
|
|
<row>
|
|
<entry>mbstring.encoding_translation</entry>
|
|
<entry>"0"</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
For further details and definition of the PHP_INI_* constants see
|
|
<function>ini_set</function>.
|
|
</para>
|
|
<para>
|
|
Here is a short explanation of the configuration directives.
|
|
<itemizedlist>
|
|
<listitem id="ini.mbstring.language">
|
|
<simpara>
|
|
<literal>mbstring.language</literal> defines
|
|
default language used in mbstring.
|
|
Note that this option defines
|
|
<literal>mbstring.interanl_encoding</literal>
|
|
and <literal>mbstring.interanl_encoding</literal>
|
|
should be placed after <literal>mbstring.language</literal>
|
|
in &php.ini;
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.encoding-translation">
|
|
<simpara>
|
|
<literal>mbstring.encoding_translation</literal> enables
|
|
HTTP input character encoding detection and translation into
|
|
internal chatacter encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.internal-encoding">
|
|
<simpara>
|
|
<literal>mbstring.internal_encoding</literal> defines default
|
|
internal character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.http-input">
|
|
<simpara>
|
|
<literal>mbstring.http_input</literal> defines default HTTP
|
|
input character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.http-output">
|
|
<simpara>
|
|
<literal>mbstring.http_output</literal> defines default HTTP
|
|
output character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.detect-order">
|
|
<simpara>
|
|
<literal>mbstring.detect_order</literal> defines default
|
|
character code detection order. See also
|
|
<function>mb_detect_order</function>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.substitute-character">
|
|
<simpara>
|
|
<literal>mbstring.substitute_character</literal> defines
|
|
character to substitute for invalid character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem id="ini.mbstring.func-overload">
|
|
<simpara>
|
|
<literal>mbstring.func_overload</literal>overload(replace) single byte
|
|
functions by mbstring functions. <function>mail</function>,
|
|
<function>ereg</function>, etc. are overloaded by
|
|
<function>mb_send_mail</function>, <function>mb_ereg</function>, etc.
|
|
Possible values are 0, 1, 2, 4 or a combination of them.
|
|
For example, 7 for overload everything.
|
|
0: No overload, 1: Overload <function>mail</function> function,
|
|
2: Overload str*() functions, 4: Overload ereg*() functions.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
Web Browsers are supposed to use the same character encoding
|
|
when submitting form. However, browsers may not use the same
|
|
character encoding. See <function>mb_http_input</function> to
|
|
detect character encoding used by browsers.
|
|
</para>
|
|
<para>
|
|
If <literal>enctype</literal> is set to
|
|
<literal>multipart/form-data</literal> in HTML forms,
|
|
<literal>mbstring</literal> does not convert character encoding
|
|
in POST data. The user must convert them in the script, if
|
|
conversion is needed.
|
|
</para>
|
|
<para>
|
|
Although, browsers are smart enough to detect character encoding
|
|
in HTML. <literal>charset</literal> is better to be set in HTTP
|
|
header. Change <literal>default_charset</literal> according to
|
|
character encoding.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting example</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
; Set default language
|
|
mbstring.language = English; Set default language to English (default)
|
|
mbstring.language = Japanese; Set default language to Japanese
|
|
|
|
;; Set default internal encoding
|
|
;; Note: Make sure to use character encoding works with PHP
|
|
mbstring.internal_encoding = UTF-8 ; Set internal encoding to UTF-8
|
|
|
|
;; HTTP input encoding translation is enabled.
|
|
mbstring.encoding_translation = On
|
|
|
|
;; Set default HTTP input character encoding
|
|
;; Note: Script cannot change http_input setting.
|
|
mbstring.http_input = pass ; No conversion.
|
|
mbstring.http_input = auto ; Set HTTP input to auto
|
|
; "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS"
|
|
mbstring.http_input = SJIS ; Set HTTP2 input to SJIS
|
|
mbstring.http_input = UTF-8,SJIS,EUC-JP ; Specify order
|
|
|
|
;; Set default HTTP output character encoding
|
|
mbstring.http_output = pass ; No conversion
|
|
mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8
|
|
|
|
;; Set default character encoding detection order
|
|
mbstring.detect_order = auto ; Set detect order to auto
|
|
mbstring.detect_order = ASCII,JIS,UTF-8,SJIS,EUC-JP ; Specify order
|
|
|
|
;; Set default substitute character
|
|
mbstring.substitute_character = 12307 ; Specify Unicode value
|
|
mbstring.substitute_character = none ; Do not print character
|
|
mbstring.substitute_character = long ; Long Example: U+3000,JIS+7E7E
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting for <literal>EUC-JP</literal> users</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Disable Output Buffering
|
|
output_buffering = Off
|
|
|
|
;; Set HTTP header charset
|
|
default_charset = EUC-JP
|
|
|
|
;; Set default language to Japanese
|
|
mbstring.language = Japanese
|
|
|
|
;; HTTP input encoding translation is enabled.
|
|
mbstring.encoding_translation = On
|
|
|
|
;; Set HTTP input encoding conversion to auto
|
|
mbstring.http_input = auto
|
|
|
|
;; Convert HTTP output to EUC-JP
|
|
mbstring.http_output = EUC-JP
|
|
|
|
;; Set internal encoding to EUC-JP
|
|
mbstring.internal_encoding = EUC-JP
|
|
|
|
;; Do not print invalid characters
|
|
mbstring.substitute_character = none
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting for <literal>SJIS</literal> users</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Enable Output Buffering
|
|
output_buffering = On
|
|
|
|
;; Set mb_output_handler to enable output conversion
|
|
output_handler = mb_output_handler
|
|
|
|
;; Set HTTP header charset
|
|
default_charset = Shift_JIS
|
|
|
|
;; Set default language to Japanese
|
|
mbstring.language = Japanese
|
|
|
|
;; Set http input encoding conversion to auto
|
|
mbstring.http_input = auto
|
|
|
|
;; Convert to SJIS
|
|
mbstring.http_output = SJIS
|
|
|
|
;; Set internal encoding to EUC-JP
|
|
mbstring.internal_encoding = EUC-JP
|
|
|
|
;; Do not print invalid characters
|
|
mbstring.substitute_character = none
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
|
|
</section>
|
|
|
|
<!-- 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:"../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|