Index: pukiwiki/html.php =================================================================== RCS file: /cvsroot/pukiwiki/pukiwiki/html.php,v retrieving revision 1.86 diff -c -r1.86 html.php *** pukiwiki/html.php 30 Jun 2003 06:12:28 -0000 1.86 --- pukiwiki/html.php 3 Jul 2003 10:46:00 -0000 *************** *** 94,99 **** --- 94,102 ---- $body = "
$_msg_word$search_word
$hr\n$body"; } + // 文字エンコーディング検出用 hidden フィルードの挿入 + $body = preg_replace("/(<[fF][oO][rR][mM][^>]*>)/","$1\n",$body); + $longtaketime = getmicrotime() - MUTIME; $taketime = sprintf('%01.03f',$longtaketime); Index: pukiwiki/init.php =================================================================== RCS file: /cvsroot/pukiwiki/pukiwiki/init.php,v retrieving revision 1.54 diff -c -r1.54 init.php *** pukiwiki/init.php 3 Jul 2003 05:30:46 -0000 1.54 --- pukiwiki/init.php 3 Jul 2003 10:46:00 -0000 *************** *** 16,23 **** define('LANG','ja'); mb_internal_encoding(SOURCE_ENCODING); mb_http_output(SOURCE_ENCODING); - mb_detect_order('ASCII,JIS,EUC,UTF-8,SJIS'); - // mb_detect_order('ASCII,JIS,UTF-8,EUC,SJIS'); // UTF-8を優先する場合 ///////////////////////////////////////////////// // 初期設定(設定ファイルの場所) --- 16,21 ---- *************** *** 144,151 **** $post = sanitize($_POST); $cookie = sanitize($_COOKIE); ! // ポストされた文字のコードを変換 ! mb_convert_variables(SOURCE_ENCODING,'auto',$get,$post); if (!empty($get['page'])) { $get['page'] = strip_bracket($get['page']); --- 142,202 ---- $post = sanitize($_POST); $cookie = sanitize($_COOKIE); ! //
で送信された文字 (ブラウザがエンコードしたデータ) のコードを変換 ! // post は常に なので、必ず変換 ! if(array_key_exists('encode_hint', $post)) ! { ! // html.php の中で、 に encode_hint を仕込んでいるので、必 ! // ず encode_hint があるはず。encode_hint のみを用いてコード検出 ! // する。全体を見てコード検出すると、機種依存文字や、妙なバイナ ! // リコードが混入した場合に、コード検出に失敗する恐れがあるため。 ! $encode = mb_detect_encoding($post['encode_hint']); ! mb_convert_variables(SOURCE_ENCODING,$encode,$post); ! } ! elseif(count($post)>0) ! { ! // encode_hint が無いということは、無いはず。デバッグ用に、取り ! // あえず、警告メッセージを出しておきます。 ! echo "

Warning: 'encode_hint' field is not found in the posted data.

\n"; ! // 全部まとめて、コード検出、変換 ! mb_convert_variables(SOURCE_ENCODING,'auto',$post); ! } ! ! // get は からの場合と、