uTools-Manuals/docs/php/mb_internal_encoding.html
2019-04-08 23:22:26 +08:00

94 lines
4.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>设置/获取内部字符编码</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.mb-internal-encoding" class="refentry">
<div class="refnamediv">
<h1 class="refname">mb_internal_encoding</h1>
<p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">mb_internal_encoding</span> &mdash; <span class="dc-title">设置/获取内部字符编码</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.mb-internal-encoding-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>mb_internal_encoding</strong></span>
([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code><span class="initializer"> = mb_internal_encoding()</span></span>
] ) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>
<p class="para rdfs-comment">
设置/获取内部字符编码
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.mb-internal-encoding-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">encoding</code></dt>
<dd>
<p class="para">
<code class="parameter">encoding</code> 字符编码名称使用于 HTTP 输入字符编码转换、HTTP 输出字符编码转换、mbstring 模块系列函数字符编码转换的默认编码。
You should notice that the internal encoding is totally different from the one for multibyte regex.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.mb-internal-encoding-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
如果设置了 <code class="parameter">encoding</code>,则成功时返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>
In this case, the character encoding for multibyte regex is NOT changed.
如果省略了 <code class="parameter">encoding</code>,则返回当前的字符编码名称。
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.mb-internal-encoding-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-3188">
<p><strong>Example #1 <span class="function"><strong>mb_internal_encoding()</strong></span> 例子</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;设置内部字符编码为&nbsp;UTF-8&nbsp;*/<br /></span><span style="color: #0000BB">mb_internal_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;显示当前的内部字符编码*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">mb_internal_encoding</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.mb-internal-encoding-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="mb_http_input.html" class="function" rel="rdfs-seeAlso">mb_http_input()</a> - 检测 HTTP 输入字符编码</span></li>
<li class="member"><span class="function"><a href="mb_http_output.html" class="function" rel="rdfs-seeAlso">mb_http_output()</a> - 设置/获取 HTTP 输出字符编码</span></li>
<li class="member"><span class="function"><a href="mb_detect_order.html" class="function" rel="rdfs-seeAlso">mb_detect_order()</a> - 设置/获取 字符编码的检测顺序</span></li>
<li class="member"><span class="function"><a href="mb_regex_encoding.html" class="function" rel="rdfs-seeAlso">mb_regex_encoding()</a> - Set/Get character encoding for multibyte regex</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>