简介
<h2>Charset — 字符集</h2>
<p>Charset是用来处理在信息交换途中,字符所采用的编码格式。Charset字符集即charset.php。是一个常量库,里面将常见的信息charset与mysql charset都进行了定义,保证字符集都是统一的、标准的格式。</p>
<h2>补充</h2>
<pre><code>define(&quot;CHARSET_UTF8&quot;, &quot;utf-8&quot;);
define(&quot;CHARSET_UTF8MB4&quot;, &quot;utf-8mb4&quot;);
define(&quot;CHARSET_ISO_8859_1&quot;, &quot;iso-8859-1&quot;);
define(&quot;CHARSET_ISO_8859_2&quot;, &quot;iso-8859-2&quot;);
define(&quot;CHARSET_ISO_8859_3&quot;, &quot;iso-8859-3&quot;);
define(&quot;CHARSET_ISO_8859_4&quot;, &quot;iso-8859-4&quot;);
define(&quot;CHARSET_ISO_8859_5&quot;, &quot;iso-8859-5&quot;);
define(&quot;CHARSET_ISO_8859_6&quot;, &quot;iso-8859-6&quot;);
define(&quot;CHARSET_ISO_8859_7&quot;, &quot;iso-8859-7&quot;);
define(&quot;CHARSET_ISO_8859_8&quot;, &quot;iso-8859-8&quot;);
define(&quot;CHARSET_ISO_8859_10&quot;, &quot;iso-8859-10&quot;);
define(&quot;CHARSET_ISO_8859_13&quot;, &quot;iso-8859-13&quot;);
define(&quot;CHARSET_ISO_8859_14&quot;, &quot;iso-8859-14&quot;);
define(&quot;CHARSET_ISO_8859_15&quot;, &quot;iso-8859-15&quot;);
define(&quot;CHARSET_ISO_8859_16&quot;, &quot;iso-8859-16&quot;);
define(&quot;CHARSET_KOI8R&quot;, &quot;koi8-r&quot;);
define(&quot;CHARSET_KOI8U&quot;, &quot;koi8-u&quot;);
define(&quot;CHARSET_BIG5&quot;, &quot;big5&quot;);
define(&quot;CHARSET_EUCJPMS&quot;, &quot;eucjpms&quot;);
define(&quot;CHARSET_GB2312&quot;, &quot;gb2312&quot;);
define(&quot;CHARSET_GBK&quot;, &quot;gbk&quot;);
define(&quot;CHARSET_EUCJP&quot;, &quot;eucjp&quot;);
define(&quot;CHARSET_SJIS&quot;, &quot;shift_jis&quot;);
define(&quot;CHARSET_TIS620&quot;, &quot;tis620&quot;);
define(&quot;CHARSET_THAI&quot;, &quot;thai&quot;);
define(&quot;CHARSET_ARMSCII8&quot;, &quot;armscii-8&quot;);
define(&quot;CHARSET_ASCII&quot;, &quot;ascii&quot;);
define(&quot;CHARSET_CP1250&quot;, &quot;cp1250&quot;);
define(&quot;CHARSET_CP1251&quot;, &quot;cp1251&quot;);
define(&quot;CHARSET_CP1252&quot;, &quot;cp1252&quot;);
define(&quot;CHARSET_CP1253&quot;, &quot;cp1253&quot;);
define(&quot;CHARSET_CP1254&quot;, &quot;cp1254&quot;);
define(&quot;CHARSET_CP1255&quot;, &quot;cp1255&quot;);
define(&quot;CHARSET_CP1256&quot;, &quot;cp1256&quot;);
define(&quot;CHARSET_CP1257&quot;, &quot;cp1257&quot;);
define(&quot;CHARSET_CP1258&quot;, &quot;cp1258&quot;);
// MySQL字符集定义
define(&quot;SQL_UTF8&quot;, &quot;utf8&quot;);
define(&quot;SQL_UTF8MB4&quot;, &quot;utf8mb4&quot;);
define(&quot;SQL_LATIN1&quot;, &quot;latin1&quot;);
define(&quot;SQL_LATIN2&quot;, &quot;latin2&quot;);
define(&quot;SQL_LATIN3&quot;, &quot;latin3&quot;);
define(&quot;SQL_LATIN4&quot;, &quot;latin4&quot;);
define(&quot;SQL_LATIN5&quot;, &quot;latin5&quot;);
define(&quot;SQL_LATIN6&quot;, &quot;latin6&quot;);
define(&quot;SQL_LATIN7&quot;, &quot;latin7&quot;);
define(&quot;SQL_LATIN8&quot;, &quot;latin8&quot;);
define(&quot;SQL_LATIN9&quot;, &quot;latin9&quot;);
define(&quot;SQL_LATIN10&quot;, &quot;latin10&quot;);
define(&quot;SQL_GREEK&quot;, &quot;greek&quot;);
define(&quot;SQL_CYRILLIC&quot;, &quot;cyrillic&quot;);
define(&quot;SQL_ARMENIAN&quot;, &quot;armennian&quot;);
define(&quot;SQL_HEBREW&quot;, &quot;hebrew&quot;);
define(&quot;SQL_JAPANESE&quot;, &quot;japanese&quot;);
define(&quot;SQL_KOREAN&quot;, &quot;korean&quot;);
define(&quot;SQL_THAI&quot;, &quot;thai&quot;);
define(&quot;SQL_COCKER&quot;, &quot;cocker&quot;);
define(&quot;SQL_ICELANDIC&quot;, &quot;icelandic&quot;);
define(&quot;SQL_LATVIAN&quot;, &quot;latvian&quot;);
define(&quot;SQL_ESTONIAN&quot;, &quot;estonian&quot;);
define(&quot;SQL_SWEDESH&quot;, &quot;swedesh&quot;);
define(&quot;SQL_Finnish&quot;, &quot;finnish&quot;);
define(&quot;SQL_Finland-Swedish&quot;, &quot;finland-swedish&quot;);
define(&quot;SQL_HUNGARIAN&quot;, &quot;hungarian&quot;);
define(&quot;SQL_IRISH&quot;, &quot;irish&quot;);
define(&quot;SQL_MALTESE&quot;, &quot;maltese&quot;);
define(&quot;SQL_ROMANIAN&quot;, &quot;romanian&quot;);
define(&quot;SQL_RUSSIAN&quot;, &quot;russian&quot;);
define(&quot;SQL_CROATIAN&quot;, &quot;croatian&quot;);
define(&quot;SQL_SERBIAN&quot;, &quot;serbian&quot;);
define(&quot;SQL_SLOVAK&quot;, &quot;slovak&quot;);
define(&quot;SQL_SLOVENIAN&quot;, &quot;slovenian&quot;);
define(&quot;SQL_SPANISH&quot;, &quot;spanish&quot;);
define(&quot;SQL_SWEDISH&quot;, &quot;swedish&quot;);
define(&quot;SQL_CATALAN&quot;, &quot;catalan&quot;);
define(&quot;SQL_WALES&quot;, &quot;wales&quot;);
define(&quot;SQL_Welsh&quot;, &quot;welsh&quot;);
define(&quot;SQL_YIDDISH&quot;, &quot;yiddish&quot;);</code></pre>