77;20202;0ccatbody
††
†
†
$detect_charset = ""; $phrase = empty( $_POST[ "phrase"]) == TRUE? "": $_POST[ "phrase"]; if ( $phrase != "") { $charsets = array( "UTF-8", "EUC-JP", "Shift_JIS", "ISO-2022-JP"); foreach ( $charsets as $charset) { if ( $phrase == mb_convert_encoding( $phrase, $charset, $charset)) { $detect_charset = $charset; break; } } }
†
$ echo '<?xml encoding="UTF-8" ?>' | \ php -r ' $string = file_get_contents( "php://stdin"); var_dump( preg_match( "/encoding=[\"]?[^\" \t>]+/", $string, $matches)); var_dump( $matches);' int(1) array(1) { [0]=> string(14) "encoding=UTF-8" } ††
mb_internal_encoding( "UTF-8"); mb_regex_encoding( "UTF-8"); †
†
php -r 'echo mb_convert_encoding( file_get_contents( "php://stdin"), "EUC-JP", "UTF-8");' php -r 'echo mb_convert_encoding( file_get_contents( "php://stdin"), "EUCJP-WIN", "UTF-8");' †
mb_language( "ja"); mb_internal_encoding( "UTF-8"); $subject = mb_convert_encoding( $subject, "ISO-2022-JP", "UTF-8"); mb_internal_encoding( "ISO-2022-JP"); $encode_subject = mb_encode_mimeheader( $subject, "ISO-2022-JP"); mail( "foo@example", $encode_subject, "test", "From: bar@example.com"); mb_language( "ja"); mb_internal_encoding( "UTF-8"); $encode_subject = mb_encode_mimeheader( $subject mail( "foo@example", $encode_subject, "test", "From: bar@example.com"); †
|