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

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

am 22.12.2008 14:51:16 von Tonado

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.


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



Thanks for any help.



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

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

am 22.12.2008 22:45:14 von dmagick

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.

Try 'AL32UTF8'.

The oracle db has to be set up to allow those sort of chars too when you
create it, you can't convert it (everything I found says you have to do
a dump/recreate the db/import the data).

http://www.oracle.com/technology/tech/globalization/htdocs/n ls_lang%20faq.htm

--
Postgresql & php tutorials
http://www.designmagick.com/


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

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

am 22.12.2008 22:55:15 von Christopher Jones

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/b282 98/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@oracle.com 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

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

am 24.12.2008 14:29:28 von Tonado

Hi Chris,

Thank you very much for the info. I found that there wasn't a library
called 'libociei.so' on my server compared with the lastest Oracle Instant
Client. I copied it to my server and then I found oci_connect(,,,'UTF8')
worked! I didn't know why but I thought you were right that my prior OCI
just supported a restricted set of character set. Thank you very much!

Regards,
Tonado

"Christopher Jones"
??????:49500CC3.8090905@oracle.com...
>
> 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/b282 98/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@oracle.com 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