CakeFest 2024: The Official CakePHP Conference

サポートされる文字エンコーディング

現在、以下の文字エンコーディングが mbstring モジュールによりサポートされています。文字エンコーディングは、 mbstring 関数の encoding パラメータで指定することが可能です。

以下の文字エンコーディングがこの PHP 拡張モジュールでサポートされています。

  • UCS-4*
  • UCS-4BE
  • UCS-4LE*
  • UCS-2
  • UCS-2BE
  • UCS-2LE
  • UTF-32*
  • UTF-32BE*
  • UTF-32LE*
  • UTF-16*
  • UTF-16BE*
  • UTF-16LE*
  • UTF-7
  • UTF7-IMAP
  • UTF-8*
  • ASCII*
  • EUC-JP*
  • SJIS*
  • eucJP-win*
  • SJIS-win*
  • ISO-2022-JP
  • ISO-2022-JP-MS
  • CP932
  • CP51932
  • SJIS-mac (エイリアス: MacJapanese)
  • SJIS-Mobile#DOCOMO (エイリアス: SJIS-DOCOMO)
  • SJIS-Mobile#KDDI (エイリアス: SJIS-KDDI)
  • SJIS-Mobile#SOFTBANK (エイリアス: SJIS-SOFTBANK)
  • UTF-8-Mobile#DOCOMO (エイリアス: UTF-8-DOCOMO)
  • UTF-8-Mobile#KDDI-A
  • UTF-8-Mobile#KDDI-B (エイリアス: UTF-8-KDDI)
  • UTF-8-Mobile#SOFTBANK (エイリアス: UTF-8-SOFTBANK)
  • ISO-2022-JP-MOBILE#KDDI (エイリアス: ISO-2022-JP-KDDI)
  • JIS
  • JIS-ms
  • CP50220
  • CP50220raw
  • CP50221
  • CP50222
  • ISO-8859-1*
  • ISO-8859-2*
  • ISO-8859-3*
  • ISO-8859-4*
  • ISO-8859-5*
  • ISO-8859-6*
  • ISO-8859-7*
  • ISO-8859-8*
  • ISO-8859-9*
  • ISO-8859-10*
  • ISO-8859-13*
  • ISO-8859-14*
  • ISO-8859-15*
  • ISO-8859-16*
  • byte2be
  • byte2le
  • byte4be
  • byte4le
  • BASE64
  • HTML-ENTITIES (別名: HTML)
  • 7bit
  • 8bit
  • EUC-CN*
  • CP936
  • GB18030
  • HZ
  • EUC-TW*
  • CP950
  • BIG-5*
  • EUC-KR*
  • UHC (別名:CP949)
  • ISO-2022-KR
  • Windows-1251 (別名:CP1251)
  • Windows-1252 (別名:CP1252)
  • CP866 (別名:IBM866)
  • KOI8-R*
  • KOI8-U*
  • ArmSCII-8 (別名:ArmSCII8)

* は、正規表現でも使えるエンコーディングであることを表します。

エンコーディング名を指定する php.ini エントリには、 "auto" および "pass" を指定することもできます。 エンコーディング名を指定する mbstring 関数にも、"auto" を指定することができます。

"pass" が指定された場合、 文字エンコーディングの変換は行われません。

"auto" が指定された場合、この文字列は 言語設定 (NLS) ごとに定義されたエンコーディングのリストに変換されます。たとえば、言語設定が Japanese の場合は "ASCII,JIS,UTF-8,EUC-JP,SJIS" です。

mb_detect_order() も参照ください。

add a note

User Contributed Notes 3 notes

up
6
Tomolimo (olivier dot moron at raynet-it dot com)
10 years ago
Apart of this list, GB2312 encoding is also supported.
It is Chinese Simplified encoding which is now superseded by GB18030, but GB2312 is not in the list.
If you try to us it, the result will allright even if it is not in the list.
Regards,
Tomolimo
up
2
Anonymous
9 years ago
CP850 (DOS-Latin-1) is also supported.
up
2
akniep at rayo dot info
11 years ago
Use mb_list_encodings() to check if an encoding is supported by mbstring before using its functions for it.
To Top