utf8_decode

(PHP 4, PHP 5, PHP 7)

utf8_decode UTF-8 エンコードされた ISO-8859-1 文字列をシングルバイトの ISO-8859-1 に変換する

説明

utf8_decode ( string $data ) : string

この関数は、文字列 dataUTF-8 エンコードから ISO-8859-1 へ変換します。 Bytes in the string which are not valid UTF-8, and UTF-8 characters which do not exist in ISO-8859-1 (that is, characters above U+00FF) are replaced with ?.

注意:

Many web pages marked as using the ISO-8859-1 character encoding actually use the similar Windows-1252 encoding, and web browsers will interpret ISO-8859-1 web pages as Windows-1252. Windows-1252 features additional printable characters, such as the Euro sign (?) and curly quotes ( ), instead of certain ISO-8859-1 control characters. This function will not convert such Windows-1252 characters correctly. Use a different function if Windows-1252 conversion is required.

パラメータ

data

UTF-8 エンコードされた文字列。

返り値

data を ISO-8859-1 に変換した結果を返します。

参考

  • utf8_encode() - ISO-8859-1 文字列を UTF-8 にエンコードする - Performs the reverse conversion
  • mb_convert_encoding() - 文字エンコーディングを変換する - Converts between various character encodings, including UTF-8, ISO-8859-1 and Windows-1252
  • iconv() - 文字列を指定した文字エンコーディングに変換する - Converts between various character encodings
  • recode_string() - コード変換指令に基づき文字列のコードを変換する - Converts between various character encodings