[PHP-users 31408] Re: PHP5.2.0でmultipart/form-dataを使用すると文字化け

Seiji Masugata s.masugata @ digicom.dnp.co.jp
2007年 2月 6日 (火) 22:32:51 JST


こんばんわ、桝形です。

> 確かPHP4.2.3あたりまでは自力でエンコード処理はしなくてはいけなかった記憶
> はあるのですが、5.2.0も自力でエンコードしないといけなくなったのでしょうか。

そんな事は無かったと思います。


> 検証ソース
> ----------------------
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
> </head>
> <body>
> <?= $_POST['string'] ?>
> <form method="post" enctype="multipart/form-data">
> <input type="text" name="string">
> <input type="submit" value="OK">
> </form>
> </body>
> </html>
> ----------------------


Apacheのバージョンが1.3系でしたが、検証ソースと以下のconfigure・
php.iniにして確認したトコロ、文字化けはしていませんでした。
(OSを除いて全てソースからインストール)

Debian3.1
Apache1.3.37
PHP5.2.0
PHP5.2.1RC5-dev(snapshot)

確実に文字化けしているのでしょうか。

例えば、ブラウザ上では文字化けしているように見えるが、ソースを
見ると正しくSJISになっている、みたいな。流石にそんな事は無い
ですよね。。。ドウモスミマセン。


> 
> 環境
> CentOS4.4
> Apache2.2.3
> PHP5.2.0
> 
> ./configure --with-pgsql --with-apxs2=/usr/local/apache2/bin/apxs \
> --enable-zend-multibyte --enable-mbstring --with-gd \
> --with-zlib-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr \
> --with-freetype-dir=/usr --with-ttf --enable-gd-native-ttf \
> --enable-gd-jis-conv --enable-sockets --enable-simplexml --with-curl
> 
> output_buffering = On
> output_handler = mb_output_handler
> magic_quotes_gpc = Off
> default_charset = Shift_JIS
> mbstring.language = Japanese
> mbstring.internal_encoding = EUC-JP
> mbstring.http_input = auto
> mbstring.http_output = SJIS
> mbstring.encoding_translation = On
> mbstring.detect_order = auto
> mbstring.substitute_character = none;
> mbstring.func_overload = 0

-- 
Seiji Masugata <s.masugata @ digicom.dnp.co.jp>



PHP-users メーリングリストの案内