Re: Oracle10 e PHP
Date: Tue, 24 Feb 2009 13:24:50 +0100
Message-ID: <go0otv$5tl$1_at_aioe.org>
[Quoted] "Gerard H. Pille" <ghp_at_skynet.be> ha scritto nel messaggio
news:49a2fa7a$0$2858$ba620e4c_at_news.skynet.be...
>
> What is the character set of your database? To contain those
> characters, it should be MSWIN1252 or one of the UTF's.
>
> What is the NLS_LANG setting of your PHP environment? "phpinfo();"
> should be able to tell you.
Phpinfo:
[Quoted] NLS_LANG: american_america.WE8MSWIN1252
NLS_NCHAR_CHARACTERSET: AL16UTF16
(SetEnv directive in httpd.conf)
Oracle:
SELECT * FROM NLS_DATABASE_PARAMETERS:
PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CHARACTERSET WE8MSWIN1252
But now I found where is the problem.
The field is a VARCHAR2 with size 254 (I cannot modify it, or NLS settings,
since it's a third-party appliance).
PHP returns an empty string ONLY IF the field is full (with all 254
characters) and contains "smart quotes".
I have infact read
(http://shiflett.org/blog/2005/oct/convert-smart-quotes-with-php#comment-13)
that smart quotes (ASCII 0x91, 0x92, 0x93, 0x94) are converted from 1 byte
to 3 bytes, and I think that the resulting string (>254 charachters) is bad
read by PHP.
(N.B.: The conversion function showed in the link doesn't resolve the
problem, because the string is already null...).
Daniele Received on Tue Feb 24 2009 - 13:24:50 CET