Win2k OS (codepage : 1252)
I am trying to build an appln in VC using OCI9 so as to work with unicode data(Devnagari-Hindi).
Case I :
Client : oracle815 (NLS_LANG=UTF8)
server : oracle815 (NLS_NCHAR_CHARACTERSET=UTf8)
If i w'd use NCHAR sql datatypes to work with unicode data, then i can successfully insert/retrieve hindi data into/from Oracle815 DB. (e.g. a Hindi char with hex code 05 09 is inserted as e0 a4 85 in Database and retrieved as e0 a5 85 which u need to convert it back to unicode using multibytetowidechar())
Case II :
Client : oracle815 or 912 (NLS_LANG=UTF8)
server : oracle912 (NLS_NCHAR_CHARACTERSET=UTf8)
In this case(ora815 client), If i w'd follow the same operation as in case I, then i dont get proper result after fetch. (e.g. a Hindi char with hex code '05 09' is inserted as 'e0 a4 85' in Database, BUT it is not retrieved back as 'e0 a5 85', but as '60 24 05'.
And if i w'd use ora912 client, then i get the result as '3F' for the same above character.
What's wrong in my program or settings.?
Plus, my another requirement is, i dont want to change NLS_LANG parameter in registry manually, but, i w'd like change it programmaticaly thru OCI. For this, i tried using OCI funct OCIEnvNlsCreate(..., csid, ncsid). I set the last two parameters to OCI_UTF16ID(The header oci.h has the only constant OCI_UTF16ID defined !. We cant use any other charsetID like UTF8 or what ?), then, i get an error 'ORA-12154: TNS: Could not resolve service name'.