Inserting a WideString into UTF8 DB

im2kul

Member²
Hi All,

I just need to find out if there is a way to insert a WideString or wchar_t into the DB using DOA?

I am using the ExecuteArray method to bulk insert rows into a UTF8 DB.

Thanks
 
Hi Macro,

Thank you for your quick reply.

I have a couple of questions:

1. Is there a way using DOA that I can have an AnsiString contain Unicode characters? This is whats currently happening: When I try to assign a WideString to an AnsiString (something like this AnsiString myString = WideString wString), the characters get grabled. Please help! I am stuck. I am trying to write Unicode chars to a UTF8 DB and am letting the Oracle Driver convert the Unicode strings to UTF8.

2. Finally, is there a way I can convert a WideString to an AnsiString? If so how?

Any help is highly appreciated!

Thanks
 
The character set of the NLS_LANG setting of the client must match the character set of your AnsiStrings. The conversion of a WideString to an AnsiString depends on the Windows system code page.
 
Hi,

Thanks for the reply.

I am not sure what is the Character Set of the AnsiString. I am just storing or trying to store Unicode characters in the AnsiString. For Unicode chars in an AnsiString, what should be my NLS_LANG? Below is the info that you might need for detailed explanation:

1. My Source DB where I have already fetched the data into a dataSet and created my data objects out of it is in NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
and the data looks good (the data was stored in the source ISO DB in UTF8)
2. When I start inserting data into the destination DB which is a UTF8 DB, I start doing the conversion of the UTF8 data stored in the AnsiString to Unicode. Before this step is done, I set the NLS_LANG=AMERICAN_AMERICA.UTF8 and then try to do conversion where the data gets garbled.

Is there something I am doing wrong? What should be the code_page for setting the AnsiString to have Unicode chars?

Thanks in advance for all the help you have provided so far.

Thanks
 
Back
Top