Re: oci_connect returns warning if provided with the 4th param(charset)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Tonado wrote:
> Hi all,
>
> I used the following in my code
> ....
> oci_connect('$user','$pass',$connectionString,'UTF8');
> ....
>
> and got the following warning:
>
> Warning: oci_connect() [function.oci-connect]: Invalid character set
> name: UTF8
> I tried many times and found it could only work when I removed
> 'UTF8' or replaced it with 'US7ASCII'. It didn't work even I used
> 'WE8ISO8859P1'. But I had to use 'UTF8' in order to support multiple
> bytes.  I had tried setting NLS_LANG to AMERICAN_AMERICA.UTF8 in
> envvars instead of using the 4th parameter in oci_connect, but it
> didn't work. Using putenv to set NLS_LANG didn't work either.

Did you build PHP with Oracle XE libraries?

Some versions of Oracle libraries support a restricted set of
character sets to reduce size.  For example, Oracle Instant Client
Basic Lite has only English error messages and Unicode, ASCII, and
Western European character set support.

Oracle XE comes in two bundles, one supporting only the character set
WE8MSWIN1252, the other AL32UTF8.  See
http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#BABJACJJ

Oracle's general name for UTF8 is AL32UTF8.  A list of character set
names is at:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28298/applocaledata.htm#i635047

> Does anyone encounter this weird issue before? The php version I'm
> using is 5.2.1.

PHP 5.2.1 is old now, and there have been many updates. If possible
upgrade PHP.

For all 5.2.x versions (including 5.2.8) I would upgrade at least the
OCI8 extension to version 1.3.  See http://pecl.php.net/package/oci8
Instructions are in http://tinyurl.com/UGPOM

Chris

--
Email: christopher.jones@xxxxxxxxxx  Tel: +1 650 506 8630
Twitter:  http://twitter.com/ghrd    Free PHP Book: http://tinyurl.com/UGPOM

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux