cvs:lib/proxy.php (1.9) より抜粋
if (strtoupper($method) == 'POST') { // 'application/x-www-form-urlencoded', especially for TrackBack ping $POST = array(); foreach ($post as $name=>$val) $POST[] = $name . '=' . urlencode($val); $data = join('&', $POST); if (preg_match('/^[a-zA-Z0-9_-]+$/', $content_charset)) { // Legacy but simple $query .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; } else { // With charset (NOTE: Some implementation may hate this) $query .= 'Content-Type: application/x-www-form-urlencoded' . '; charset=' . strtolower($content_charset) . "\r\n"; }
この部分のpreg_match 関数では、$content_charset 変数が、EUC-JP やUTF-8 などの英数文字のみで構成されている場合にはcharset が出力されず、空文字であったり英数文字以外(マルチバイト文字など)が使われているときにcharset が出力されるようになっています。
条件が逆のような気がするのですが、気のせいでしょうか? 作り直す という話題がある今となっては、遅すぎる提案かもしれませんが。