mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 23:08:55 +00:00

* clarify the meaning of "width" in this context * fix character width info (cf. https://github.com/php/php-src/blob/master/ext/mbstring/libmbfl/mbfl/eaw_table.h) * remove the misinformation that multibyte characters would usually be twice as wide than single byte characters git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344481 c90b9560-bf6c-de11-be94-00142212c4b1
126 lines
4.4 KiB
XML
126 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.mb-strwidth" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_strwidth</refname>
|
|
<refpurpose>Return width of string</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_strwidth</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>mb_internal_encoding()</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns the width of <type>string</type> <parameter>str</parameter>,
|
|
where halfwidth characters count as <literal>1</literal>, and fullwidth
|
|
characters count as <literal>2</literal>.
|
|
</para>
|
|
<para>
|
|
The fullwidth characters are:
|
|
<literal>U+1100</literal>-<literal>U+115F</literal>,
|
|
<literal>U+11A3</literal>-<literal>U+11A7</literal>,
|
|
<literal>U+11FA</literal>-<literal>U+11FF</literal>,
|
|
<literal>U+2329</literal>-<literal>U+232A</literal>,
|
|
<literal>U+2E80</literal>-<literal>U+2E99</literal>,
|
|
<literal>U+2E9B</literal>-<literal>U+2EF3</literal>,
|
|
<literal>U+2F00</literal>-<literal>U+2FD5</literal>,
|
|
<literal>U+2FF0</literal>-<literal>U+2FFB</literal>,
|
|
<literal>U+3000</literal>-<literal>U+303E</literal>,
|
|
<literal>U+3041</literal>-<literal>U+3096</literal>,
|
|
<literal>U+3099</literal>-<literal>U+30FF</literal>,
|
|
<literal>U+3105</literal>-<literal>U+312D</literal>,
|
|
<literal>U+3131</literal>-<literal>U+318E</literal>,
|
|
<literal>U+3190</literal>-<literal>U+31BA</literal>,
|
|
<literal>U+31C0</literal>-<literal>U+31E3</literal>,
|
|
<literal>U+31F0</literal>-<literal>U+321E</literal>,
|
|
<literal>U+3220</literal>-<literal>U+3247</literal>,
|
|
<literal>U+3250</literal>-<literal>U+32FE</literal>,
|
|
<literal>U+3300</literal>-<literal>U+4DBF</literal>,
|
|
<literal>U+4E00</literal>-<literal>U+A48C</literal>,
|
|
<literal>U+A490</literal>-<literal>U+A4C6</literal>,
|
|
<literal>U+A960</literal>-<literal>U+A97C</literal>,
|
|
<literal>U+AC00</literal>-<literal>U+D7A3</literal>,
|
|
<literal>U+D7B0</literal>-<literal>U+D7C6</literal>,
|
|
<literal>U+D7CB</literal>-<literal>U+D7FB</literal>,
|
|
<literal>U+F900</literal>-<literal>U+FAFF</literal>,
|
|
<literal>U+FE10</literal>-<literal>U+FE19</literal>,
|
|
<literal>U+FE30</literal>-<literal>U+FE52</literal>,
|
|
<literal>U+FE54</literal>-<literal>U+FE66</literal>,
|
|
<literal>U+FE68</literal>-<literal>U+FE6B</literal>,
|
|
<literal>U+FF01</literal>-<literal>U+FF60</literal>,
|
|
<literal>U+FFE0</literal>-<literal>U+FFE6</literal>,
|
|
<literal>U+1B000</literal>-<literal>U+1B001</literal>,
|
|
<literal>U+1F200</literal>-<literal>U+1F202</literal>,
|
|
<literal>U+1F210</literal>-<literal>U+1F23A</literal>,
|
|
<literal>U+1F240</literal>-<literal>U+1F248</literal>,
|
|
<literal>U+1F250</literal>-<literal>U+1F251</literal>,
|
|
<literal>U+20000</literal>-<literal>U+2FFFD</literal>,
|
|
<literal>U+30000</literal>-<literal>U+3FFFD</literal>.
|
|
All other characters are halfwidth characters.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>str</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The <type>string</type> being decoded.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
&mbstring.encoding.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
The width of <type>string</type> <parameter>str</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_strimwidth</function></member>
|
|
<member><function>mb_internal_encoding</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- 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: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|