Page 1 of 1

[patch_done] Oracle CharacterSet's

Posted: 09.06.2012, 13:31
by EgonHugeist
Hi to all,

actually i'm reworking the oracle support of Zeos7.

While doing this job i was running into one issue.

Short description:
I've made a list of all available charactersets which i've found in the documentations of oracle. Now i decided to set the nls_lan and nls_nchar charactersets to the same id with the EnvNlsCreate(FHandle, OCI_DEFAULT, nil, nil, nil, nil, 0, nil,
OCI_CLIENT_CHARSET_ID, OCI_CLIENT_CHARSET_ID);

That works very well. Now i can use an UTF8 or System-compatible characterset for all char fields. The server does now all char convertations like on our free engines.

Now to my issue:
If i want to read a CLOB i have to know how many bytes one char could have or i get the error 99:OCI_NEED_DATA from the server if i try to read with readbyte=characters. Max 3 bytes per utf8 char for example. But on the documentions i've found a very long list of multibyte charactersets like JA16SJISTILDE. In my mind we do not support such charactersets actually and runnning allways into the same issue.

How can i read out such meta-informations or where can i find the bytes/char on the documentations?

a list of the characterset is available here:
http://docs.oracle.com/cd/B28359_01/ser ... m#NLSPG014

but i didn't found one article which helps me to solve this issue...

Best regards,

Michael

Posted: 07.07.2012, 20:10
by ludob
OCINlsNumericInfoGet( dvoid *hndl, OCIError *errhp, sb4 *val, ub2 item) is what you are looking for with item=OCI_NLS_CHARSET_MAXBYTESZ. Bytes per char is returned in val.

const OCI_NLS_CHARSET_MAXBYTESZ = 91;

http://docs.oracle.com/cd/B10500_01/ser ... .htm#14288

Ludo

Posted: 08.07.2012, 11:12
by EgonHugeist
ludob,

Yes! This is exacly what i'm looking for, Ludo. Thank you. Patch comes today.

Michael

Patch done: Rev. 1466 Now we do support all MBCS's on \testing-egonhugeist and UTF8 on \testing