I had try ocilib connected Oracle10g, if the column is ansi character,it's
ok,the program compile and execute is right,
but is column value contain GB2312 or GBK character,the program can't exeute.
In pl/sql view the table data
is correct.
if compile demo file with OCI_CHARSET_UNICODE and link program with -locilibw
, program can execute,but get data value was wrong.
and use OCI_CHARSET_UNICODE option, must use wchar_t for string parameter,too
many parameter must covert string and char to wchar_t,
it's not suitable for programer covert it everywhere.
my environment is :
windows 2000 professional
MINGW32 5.1.6
gcc 3.4.5
ocilib 3.4.0
Oracle 10.2.4(Database character is utf8 and use jdbc can query GB2312 string
value)
use ocilib demo file to compile,add OCI_API=__stdcall, OCI_CHARSET_ANSI,
OCI_IMPORT_LINKAGE to gcc Preprocessor ,
add ocilib\include to gcc include file path, add ociliba for gcc linker
libraries ,add ocilib\lib32 to gcc linker
library search path, add ocilib\lib32 to system path.
what and how can i do, then the program can read GB2312 code character by
ocilib?
Someone can give me a demo and setting ?
Thinks !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, I had tried use OCI_CHARSET_MIXED ,if use this option, all function
string parameter must use wchar_t type.
In c++ program,we can use string object store UTF8 or GB2312 character, then
print it does'nt covert to wchar_t.
For another question:
sometime use OCI_GetString(rs,col_index) or OCI_GetString(rs,col_name) occur
some error ,how to handler it? the demo
can't handler this error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had try ocilib connected Oracle10g, if the column is ansi character,it's
ok,the program compile and execute is right,
but is column value contain GB2312 or GBK character,the program can't exeute.
In pl/sql view the table data
is correct.
if compile demo file with OCI_CHARSET_UNICODE and link program with -locilibw
, program can execute,but get data value was wrong.
and use OCI_CHARSET_UNICODE option, must use wchar_t for string parameter,too
many parameter must covert string and char to wchar_t,
it's not suitable for programer covert it everywhere.
my environment is :
windows 2000 professional
MINGW32 5.1.6
gcc 3.4.5
ocilib 3.4.0
Oracle 10.2.4(Database character is utf8 and use jdbc can query GB2312 string
value)
use ocilib demo file to compile,add OCI_API=__stdcall, OCI_CHARSET_ANSI,
OCI_IMPORT_LINKAGE to gcc Preprocessor ,
add ocilib\include to gcc include file path, add ociliba for gcc linker
libraries ,add ocilib\lib32 to gcc linker
library search path, add ocilib\lib32 to system path.
what and how can i do, then the program can read GB2312 code character by
ocilib?
Someone can give me a demo and setting ?
Thinks !
Hi,
first, have you tried OCI_CHARSET_MIXED ?
and what is wrong with the unicode build when you say ",but get data value
was wrong"
OCILIB doest not know about encoding... it just manipulate ansi string or
UTF16 oracle oci strings data mapped to wchar_t...
Version 4.0.0 will introduce the choice of using ansi, utf8, utf16 or utf32
charset type.
yes, I had tried use OCI_CHARSET_MIXED ,if use this option, all function
string parameter must use wchar_t type.
In c++ program,we can use string object store UTF8 or GB2312 character, then
print it does'nt covert to wchar_t.
For another question:
sometime use OCI_GetString(rs,col_index) or OCI_GetString(rs,col_name) occur
some error ,how to handler it? the demo
can't handler this error.
database application use C++ is better more then C,. I'm try use occi ,but
it's not support gcc3.4,so i found ocilib and try it.
withh OCI_CHARSET_MIXED, only user data are wchar_t.
Sql queries, attributes are char.
what errors are you talking about for OCI_GetString() ?
like this:
database table has 10 row data, sometime use OCI_GetString() get table data,
then get eighth row occur some error ,how to handler it?