Dear all,
I just pass on version 6.1 SP1 of TD with Oracle 10G database.(I was using version 4.2.)
The data are in Chinese (16bits encoding for these characters).
With TD 4.2, I had no problems, but TD 6.1 can neither read nor write correctly the information ... It seems the problem come from the oracle dll drivers.
Enclosed this post, the setting of my database and an example of the data reported by TD and what should be reported.
best regards
Read/write incorrect in DB oracle with Chinese characters
Read/write incorrect in DB oracle with Chinese characters
You do not have the required permissions to view the files attached to this post.
Last edited by RicoT on 04 Jul 2012, 15:31, edited 1 time in total.
Re: Read/write incorrect in DB oracle with Chinese characters
My guess is that because of v4.2 you have some ANSI data in your Oracle DB and now with TD v6.x and Unicode, your app is fetching and displaying that ANSI data 'as is,' and TD cannot display ANSI data -- in a msg. box, field, table window column, etc.
Write yourself a small test case to fetch this CLT data and test by calling TD functionSalStrToWideChar(), which converts an ANSI string to Unicode. See TD help for details, but something like:
! assume sINPUT_ANSIString is an INTO var. in your SELECT query...
Call SalStrToWideChar( sINPUT_ANSIString, sOUTPUT_UnicodeString, ENC_UTF8 )
! now sOUTPUT_UnicodeString should be Unicode, so you could put that in a msg. box, assign to your "NOM" TW column for that row, etc.
I'D RECOMMEND you keep it very simple at first:
* fetch CLT into sINPUT_ANSIString
* call the WideChar function
* display sOUTPUT_UnicodeString in a SalMessageBox
Write yourself a small test case to fetch this CLT data and test by calling TD functionSalStrToWideChar(), which converts an ANSI string to Unicode. See TD help for details, but something like:
! assume sINPUT_ANSIString is an INTO var. in your SELECT query...
Call SalStrToWideChar( sINPUT_ANSIString, sOUTPUT_UnicodeString, ENC_UTF8 )
! now sOUTPUT_UnicodeString should be Unicode, so you could put that in a msg. box, assign to your "NOM" TW column for that row, etc.
I'D RECOMMEND you keep it very simple at first:
* fetch CLT into sINPUT_ANSIString
* call the WideChar function
* display sOUTPUT_UnicodeString in a SalMessageBox
Re: Read/write incorrect in DB oracle with Chinese characters
Thank you for your prompt answer.
We have already tried to convert the received characters, without success ...
Here after is our code, for each message called in TD I join the result:
Set sMSG = "no connexion"
If NOT SqlConnect ( hSql )
Return FALSE
Call SqlPrepareAndExecute( hSql, " SELECT NOM FROM CLT
WHERE IDTCLT = '1289'
INTO :sNOM ")
Call SqlFetchNext( hSql, nInd )
Set sMSG = sNOM
Call SalMessageBox ( sMSG , "Fetch" , 16 )
Without conversion: Call SalStrToMultiByte( sNOM, sMSG, ENC_UTF8 )
Call SalMessageBox ( sMSG , "SalStrToMultiByte" , 16 )
a result, but not the good one... Call SalStrToWideChar( sNOM, sMSG, ENC_UTF8)
Call SalMessageBox ( sMSG , "SalStrToWideChar " , 16 )
no data after conversion: Best regards
We have already tried to convert the received characters, without success ...
Here after is our code, for each message called in TD I join the result:
Set sMSG = "no connexion"
If NOT SqlConnect ( hSql )
Return FALSE
Call SqlPrepareAndExecute( hSql, " SELECT NOM FROM CLT
WHERE IDTCLT = '1289'
INTO :sNOM ")
Call SqlFetchNext( hSql, nInd )
Set sMSG = sNOM
Call SalMessageBox ( sMSG , "Fetch" , 16 )
Without conversion: Call SalStrToMultiByte( sNOM, sMSG, ENC_UTF8 )
Call SalMessageBox ( sMSG , "SalStrToMultiByte" , 16 )
a result, but not the good one... Call SalStrToWideChar( sNOM, sMSG, ENC_UTF8)
Call SalMessageBox ( sMSG , "SalStrToWideChar " , 16 )
no data after conversion: Best regards
You do not have the required permissions to view the files attached to this post.
Re: Read/write incorrect in DB oracle with Chinese characters
TD in older versions was less accurate about the type of string and we take advantage (without knowing) of a mistake we made in the Oracle database.
Indeed, for Chinese characters, WE8ISO8851P1 character set is incorrect! We therefore migrate WE8ISO8859P1 character set to ZHS16GBK.
The probleme is solve.
Best regards.
RicoT
Indeed, for Chinese characters, WE8ISO8851P1 character set is incorrect! We therefore migrate WE8ISO8859P1 character set to ZHS16GBK.
The probleme is solve.
Best regards.
RicoT
Who is online
Users browsing this forum: [Ccbot] and 0 guests