PHP/ʸ»ú¥³¡¼¥É ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×(No.3)
- ¥Ð¥Ã¥¯¥¢¥Ã¥×°ìÍ÷
- º¹Ê¬ ¤òɽ¼¨
- ¸½ºß¤È¤Îº¹Ê¬ ¤òɽ¼¨
- ¥½¡¼¥¹ ¤òɽ¼¨
- PHP/ʸ»ú¥³¡¼¥É ¤Ø¹Ô¤¯¡£
- 1 (2008-04-27 (Æü) 07:46:38)
- 2 (2008-04-27 (Æü) 07:50:32)
- 3 (2008-11-03 (·î) 07:30:54)
- 4 (2008-11-03 (·î) 12:02:24)
ʸ»ú¥³¡¼¥ÉÀßÄê¤òɽ¼¨
print_r(mb_get_info("all"));
¥¹¥¯¥ê¥×¥ÈÆâ¤Ç¤Îʸ»ú¥³¡¼¥ÉÀßÄê
#pre{{
mb_language('Japanese');
ini_set('mbstring.detect_order', 'auto');
ini_set('mbstring.encoding_translation', 0);
ini_set('mbstring.http_input', 'pass');
ini_set('mbstring.http_output', 'pass');
ini_set('mbstring.internal_encoding', 'UTF-8');
ini_set('mbstring.script_encoding', 'UTF-8');
ini_set('mbstring.substitute_character', 'none');
if (isset($_GET)) {
mb_convert_variables(mb_internal_encoding(), mb_http_input(), $_GET);
}
if (isset($_POST)) {
mb_convert_variables(mb_internal_encoding(), mb_http_input(), $_POST);
}
}}
¥Í¥¿¸µ¤«¤é¤¯¤ê²°¤Î¥Ö¥í¥°
UTF-8¤Çºî¤Ã¤¿¥Ú¡¼¥¸¤òShift-JIS¤Ç½ÐÎϤ¹¤ëÊýË¡
#pre{{
<?php
header('Content-Type: text/html; charset=Shift_JIS');
ob_start();
?>
¤³¤³¤ËShift-JIS¤Ç½ÐÎϤ·¤¿¤¤ÆâÍƤòUTF-8¤Çµ½Ò¡£
<?php
$output = ob_get_contents();
ob_end_clean();
echo mb_convert_encoding($output, "SJIS", "UTF-8");
?>
}}
¥Í¥¿¸µIDEA*IDEA