Re: mbstring: Japanese: encoding conversion not workingfor me
| From: | Jean-Christian Imbeault | Date: | Tue, 09 Jul 2002 09:37:27 +0000 |
| Subject: | Re: mbstring: Japanese: encoding conversion not workingfor me | ||
| References: | 1 2 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-267@lists.php.net to get a copy of this message | ||
Yasuo Ohgaki wrote:
>
> I guess you are using PostgreSQL 7.2.x.
Yes, 7.2.1.
> PostgreSQL 7.2.x detects invalid multibyte character sequence, and
> you are supposed to fix invalid char sequence before feeding them
> to PostgreSQL if there is.
That makes sense.
> Check your db encoding also with "psql -l", database encoding
> should match with your PHP internal encoding.
It is correctly set to EUC_JP.
I tought I had read that PHP 4.x with the mbstring library installed
will automatically convert and input ($_POST vars for example) into the
correct internal encoding. Is this true?
If this is true it seems not to be working for me. I have the following
diagnostics:
// The internal encoding is EUC-JP but the user input was not converted
// automatically. I is still in SJIS!
mb_internal_encoding() : EUC-JP
$_POST["textfield"] : 111? ?????@????????1235
mb_detect_encoding() : SJIS
// PHP has mb_http_input set to pass even though php.ini is
// mbstring.http_input = auto and I compiled with
// --enable-mbstring-enc-trans
// also mb_convert_encoding says that my encoding is set to "pass"
// but I compiled with --enable-mbstring-enc-trans!
mb_detect_order() : ASCII, JIS, UTF-8, EUC-JP, SJIS
mb_http_input() : FALSE
mb_convert_variables say encoding is : pass
mb_http_output() : pass
Am I right in thinking that if I set the internal encoding then I
shouldn't need to do any conversion before putting data into my DB
(which only accepts EUC)? From the tests I have run it seems like PHP
accepts the data and *keeps* it in it's original encoding ...
Thank you for all you help!
Jc