[PHP-users 33521] (無題)

tatsuya matsuyama tatsuya @ kk-okamoto.jp
2008年 5月 10日 (土) 11:10:00 JST


松山と申します。

ちょっと古いスレッドですが、
http://ml.php.gr.jp/pipermail/php-users/2002-November/011548.html
「[PHP-users 11542] ms-拡張領域の文字をphpからSQLserver(NT)へinsertしたい 」
を質問させていただいた者です。

その後、DB側をNT4.0SP6a+SQLserver7.0から
Win2003server+SQLserver2000へ以降させ
少しずつ環境を更新してまいりました。

そして、現在、質問当時のコンテンツを
RedHat7.3J + php-4.2.3-multibyte.tar.gzの環境を
RedHatES3+php-4.3.2(rpm版?)へ
移すテストを行っています。

コンテンツ自体も当時のまま
SJIS-winで書かれたテンプレート用htmlファイルに
phpでSQLserver2000からデーターを拾って
表示、入力させるものです。

コンテンツの使用環境に変更はなく
Windowsに統一されたクライアント20台前後から
本件のWebアプリを通じて、SQLserver2000へ
ms-拡張領域の文字を含むデーターをinsertします。

まだ、inesrtへ至る前段階の
表示の部分でつまずいています。

移転先のphpのconfigureオプションは下記のとおりです。
# 自分でセットアップしていないのですが
# rpm版なのかな?rpm -qa でphp-4.3.2-43.entが返ります。
--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization' '--with-bz2'
'--with-db4=/usr' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd'
'--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-ncurses'
'--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl'
'--with-png' '--with-pspell' '--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path'
'--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx'
'--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex'
'--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared'
'--enable-memory-limit' '--enable-bcmath' '--enable-shmop'
'--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio'
'--enable-mcal' '--with-apxs2filter=/usr/sbin/apxs'

これに、質問当初と同じ、
mbstring.internal_encoding    = SJIS-win
mbstring.http_input            = pass
mbstring.http_output          = SJIS-win
mbstring.detect_order         = auto
mbstring.substitute_character = pass
mbstring.script_encoding      = Shift-JIS
の設定をかけてテストしてみました。

これが、例えば「松山」が「セセサウ テ」フ・」のように
返ってきた漢字が全て文字化けします。
テンプレート用のファイルのsjisの漢字は正常に表示されますので、
apache側の問題ではないと考えています。

Webを確認したところ、
mbstring.script_encodingの設定がphpのmake時に
--enable-zend-multibyteの設定がなされていないと有効にならない
という文言をみつけました。

ソースを用意してmakeする前に知りたいのですが、
このコンテンツを移転先のサーバーに移動するには
当時と同じsjis統一で考える方が良いのでしょうか?


それとも、別の方法を模索すべきでしょうか?






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