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


-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to