¥È¥Ã¥×   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

PHP/ʸ»ú¥³¡¼¥É ¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×º¹Ê¬(No.4)


  • Äɲ䵤줿¹Ô¤Ï¤³¤Î¿§¤Ç¤¹¡£
  • ºï½ü¤µ¤ì¤¿¹Ô¤Ï¤³¤Î¿§¤Ç¤¹¡£
[[PHP]]

*ʸ»ú¥³¡¼¥ÉÀßÄê¤òɽ¼¨
 print_r(mb_get_info("all"));

ɽ¼¨Îã
 [internal_encoding] => UTF-8
 [http_input] =>
 [http_output] => SJIS-win
 [func_overload] => 0
 [func_overload_list] => no overload
 [mail_charset] => ISO-2022-JP
 [mail_header_encoding] => BASE64
 [mail_body_encoding] => 7bit
 [illegal_chars] => 0
 [encoding_translation] => Off
 [language] => Japanese
 [detect_order] => Array ( [0] => ASCII [1] => JIS [2] => UTF-8 [3] => EUC-JP [4] => SJIS )
 [substitute_character] => none
 [strict_detection] => Off



*¥¹¥¯¥ê¥×¥ÈÆâ¤Ç¤Îʸ»ú¥³¡¼¥ÉÀßÄê
#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);
	}
}}

¥Í¥¿¸µ[[¤«¤é¤¯¤ê²°¤Î¥Ö¥í¥°>http://blog.karakuriya.biz/web/000708.html]]



*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>http://www.ideaxidea.com/archives/2008/04/phpob_start.html]]



*mb_send_mail¤ò»È¤ï¤ºPEAR::Mail¤ÇSMTPÁ÷¿®¤¹¤ë
mb_send_mail¤ÇÍøÍѤµ¤ì¤ëʸ»ú¥³¡¼¥É¤Ïlanguage¥Ñ¥é¥á¡¼¥¿¤Ë°Í¸¤·¡¢language¤ËJapanese¤È»ØÄꤷ¤Æ¤âISO-2202-JP¡¢UTF-8¡¢SJIS¤ÇÁ÷¤ë¤Î¤«Á´¤¯ÉÔÌÀ¤Î¤¿¤á¡£
¤½¤ì¤Ë¥Þ¥ë¥Á¥Ñ¡¼¥È¥á¡¼¥ë¤Î¾ì¹ç¤Ïʸ»ú¥³¡¼¥É¤¬°ìΧ¤Ç¤Ê¤¤¤³¤È¤¬¤¢¤ê¡¢Î㤨¤Ðdocomo¤Î¥Ç¥³¥á¡¼¥ë¤Ï¥Æ¥­¥¹¥ÈÉôʬ¤ÏJIS¤À¤¬HTMLÉôʬ¤ÏSJIS¤È¤Ê¤ê¤Þ¤¹¡£

¥Í¥¿¸µ[[£Ð£È£Ð¤Îʸ»ú²½¤±¤òËܵ¤¤Ç²ò·è¤¹¤ë ¤®¤¸¤å¤Ã¤ä¤µ¤ó>http://hain.jp/index.php/tech-j/2007/02/13/p125#more125]]