Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 10G - character sets.
Problem solved!
Two OCIAttrSet() did the job. I set OCI_ATTR_CHARSET_ID to the character set id I need and OCI_ATTR_CHARSET_FORM to SQLCS_NCHAR and it works like a charm.
Its 'funny' that this is not handled by the PHP OCI code - I wonder how they get it work.
Thank you Laurenz and Sybrand.
On Jan 9, 1:38 pm, "markpapadakis" <markpapada..._at_gmail.com> wrote:
> > 927 is not a possible character in WE8MSWIN1252.
>
> > But you said that your national character set is AL16UTF16, and in this
> > character set 927 is the greek capital letter omicron (but not omega!).
>
> > Is it possible that you have selected an omicron and not an omega?
> > Is the column ARTTITLE of table ARTICLES an NCHAR or NVARCHAR column?Hm, indeed!
> It is an NVCHAR as opposed to being a CHAR.
>
> Name Null? Type
> ARTTITLE NOT NULL NVARCHAR2(500)
>
> > > Same here. Perhaps sqlplus is utilizing some sort of functionality
> > > which ends up getting the text in the proper encoding.No, it doesn't. There's no magic in sqlplus :^)
>
> > If it is like I suspect, and you have NCHAR columns, then the data in
> > your database is correct. This is a good message and explains why
> > sqlplus retrieves them correctly.In such a case, what should I do to access them ?
>
> > I have a suspicion, though:
> > I guess that there is a problem in the setting of NLS_LANG in these
> > clients. I don't know how to do it in PHP, but have you tried outputting
> > the current value of that environment variable in the code right
> > before you establish the connection?
>
> > Something like printf("%s\n", getenv("NLS_LANG")); (in C) {
> char *nlsLang = getenv("NLS_LANG");
> if (nlsLang)
> printf("NLS_LANG = %s\n", getenv("NLS_LANG"));
>
> }outputs:
>
> NLS_LANG = GREEK_GREECE.EL8ISO8859P7
>
> same goes for the PHP script (i.e echo($_ENV['NLS_LANG']) ).
>
>
>
> > Then we would know for certain if the variable is set correctly there.
>
> > A second approach would be to turn on client tracing and see what actually
> > passes to and from the database. One should be able to determine NLS
> > problems with that. But try the printf first.Hm, how do I turn on client tracing? perhaps controlled via an
> environment variable or some OCI calls?
>
> Perhaps some special treatment is required for NVCHARS ? i.e NLS_LANG
> may not apply to them?
>
> Thank you!
> Mark
>
> > Yours,
> > Laurenz Albe
Received on Tue Jan 09 2007 - 06:28:17 CST