How to get the charset the Client uses

lecare039

Member²
Hi,

I now found the function TOracleSession.CurrentCharSetID - it's not mentioned in the help! So first question is, what does the result points out?
I thought, it's the ID of that charset, which is mentioned by NLS_LANG. But on my tests the result will always be 178 for all (tested) ASCII-Charset and 873 for UTF8 and AL32UTF8. Where as 178 original does meen WE8MSWIN1252 and 873 AL32UTF8.

For testing purpose I set the NLS_LANG via the corresponding path in registry. And as I got thies 2 different results, it's the right path. But, why isn't it 46 while NLS_LANG is set to be WE8ISO8859P15?

All in all: (For debug reason) I want to get the character set, which is set via NLS_LANG and therefor used by the OracleClient and (as I thought) by DOA. So how to get this info?

PS: Is there any const, var or function related to character set, unicode etc. mentioned in your helpfile?

best regards
 
You cannot use TOracleSession.CurrentCharSetID, which is for internal purposes only.

At the moment you can only get the client character set by calling the NLS_LANG function from the OracleCI unit. Strip the part before the dot, and you have the character set.
 
No, TOracleSession.CurrentCharSetID changes if I modified the environment var NLS_LANG - but as sad befor, only to one of the 2 values 178 or 873. And this var doesn't have anythink to do with the DB server.
 
Back
Top