Page 1 of 1

Unicode - UTF-16 or UTF-8?

Posted: Wed 27 Sep 2006 13:10
by ulebule
We plan to use OraDirect in the Unicode-mode for the next version of our software. Now I'm checking what we have to modify in the DB-instance and in our code to fully support unicode.
I've read that OraDirect uses UTF-16 when we set Unicode=true in the connect string.
When I create a new database instance, I can configure Oracle only to use AL32UTF8 as Database Character Set. There doesn't seem to exist a way to configure it to use UTF16.
So, is there a problem if OraDirect uses UTF-16 and Oracle uses UTF-8?

Thank you very much for your help!
Best regards,
Tom

Posted: Wed 27 Sep 2006 14:07
by Paul
There is no way to define UTF-16 charset for database using Oracle client wizards. In .NET application you will get conversion from UTF-16 to UTF8 or any national charset.
You can avoid string conversion if you use UTF-16 charset for NCHAR, NVARCHAR fields.
Unicode mode in OraDirect .NET turns on ability of Oracle client to send SQL texts and parameter values in UTF-16 charset. Oracle converts these UTF-16 values to UTF8 for UTF8 database.

Posted: Wed 27 Sep 2006 14:19
by ulebule
So, there is no problem when we access a VARCHAR field. OraDirect or Oracle automatically converts the data to UTF-8, right?

Posted: Wed 27 Sep 2006 14:31
by Paul
Yes, there is no problem.
In Unicode=true the conversion is from UTF-8 to UTF-16 by Oracle server.
In Unicode=false the conversion is from UTF-8 to by Oracle server and
from to UTF-16 by OraDirect .Net

Posted: Wed 27 Sep 2006 14:37
by ulebule
These are good news!
Thank you for your support.

Best regards,
Tom

Posted: Thu 28 Sep 2006 05:55
by Alexey
You are welcome.