[oci8] How to set up DatabaseCharacterSet?

Questions[oci8] How to set up DatabaseCharacterSet?
Miroslaw Merena asked 10 years ago

Is it possible to set up AL32UTF8 character set (or other) at Oracle DB connection? PHP oci_connect() function has $character_set parameter, but jqgrid() constructor it hasn't…

2 Answers
Abu Ghufran answered 10 years ago

You can change charset using following code.

$g = new jqgrid(…);
$g->con->SetCharSet('AL32UTF8');

This lib uses adodb wrapper as database layer. So more help from there.
http://phplens.com/lens/adodb/docs-adodb.htm

Miroslaw Merena answered 10 years ago

Thanks, adodb-doc helped me.

While SetCharSet($charset):
"This is database driver specific and only supported for mysql, mysqlt, mysqli, and also postgres7 and later."

But:
"You can also set the charSet for Oracle 9.2 and later, supported since PHP 4.3.2, ADOdb 4.54:
$conn->charSet = 'we8iso8859p1';
$conn->Connect(…);
"

So I modified jqgrid(…) constructor:


$this->con->charSet = $db_conf["charset"];
$this->con->Connect($db_conf["server"], $db_conf["user"], $db_conf["password"], $db_conf["database"]);

and works fine 😉

Your Answer

1 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?