Solved TD-15670: Language issue with Sybase

Post found bugs and possible workarounds.
johaplar

TD-15670: Language issue with Sybase

Post by johaplar » 18 May 2011, 17:09

Hi,

We are experiencing a major problem (show stopper??) after having converted our application from TD 3.1PTF4 to TD 6.0SP2 Win32 (build 24565).

It’s a language issue regarding conversion to/from Sybase. Our Swedish special characters (Å,Ä,Ö,å,ä,ö; ASCII decimal 197,196,214,229,228,246) are distorted in the Sybase stored procedure as parameter values and in raiserror messages. Text strings selected directly from database tables are showing OK.

Platform: Windows XP SP3

Example:

Procedure call: execute Omrade_RM_v1 6,'Göteborg ',NULL

Extract from log file saying ’Area does not exist’. Fourth letter should have been ’å’:

2011-05-18 17:54:57:970000: OR_013: ** FEL **: SybServerMsg: Felkod/nivå: 20041/16: OmrÕde finns ej.


Could you please help out?

Regards Lars-Olof

Jeff Luther

Re: TD-15670: Language issue with Sybase

Post by Jeff Luther » 18 May 2011, 23:52

Sounds like a Unicode issue of some sort. v6 is in Unicode, <= v4.2 were not.

Just to be sure I understand: Any error or other msgs that come back from Sybase as errors or SP params. don't display the Umlaut/SW chars. correctly? Is the Sybase DB a Unicode DB?

I'd write a small test case for this and look in TD help for SalStrToWideChar() and its opposite. It's possible that those values coming back aren't Unicode and need to be converted to a Unicode string to display correctly in TD. Otherwise, you will need to supply a small test and details about what you see.

johaplar

Re: TD-15670: Language issue with Sybase

Post by johaplar » 19 May 2011, 08:24

Hi Jeff,

I'm positive it's a UNICODE issue, and I'm fully aware of that TD 6.0 is in UTF-16, but it was my understanding that you didn't have to do anything special in the application to communicate with the database. That the conversion was implicit. Therefore, in my view, it was a bug which is why I reported it in this forum. Are you saying we have to convert the parameter values to ANSI (SalStrToMultiByte) when passing them to the stored procedures and vice versa (SalStrToWideChar) when receiving error messages? In that case it would have been helpful with equivelant ********X functions that returned the output, but I guess we can write them ourselves.

No, our Sybase DB is not in UNICODE.

Thanks for your help. I hope it works.

johaplar

Re: TD-15670: Language issue with Sybase

Post by johaplar » 19 May 2011, 09:56

Jeff Luther wrote:Just to be sure I understand: Any error or other msgs that come back from Sybase as errors or SP params. don't display the Umlaut/SW chars. correctly?
Sorry, I didn't confirm on this question.

Yes: Error messages coming back from Sybase don't disply correctly. Other characters have replaced our umlaut characters. ANSI to UNICODE conversion is not working properly.

No: Our special umlaut characters are not converted correctly to Sybase when put in parameter values to stored procedures.
Normally valid parameter values are no longer valid because of the umlaut characters not being properly converted to ANSI.
I have just now tried to use SalStrToMultiByte (with ENC_ANSI) but the conversion just makes it worse - I get question marks for all characters as output. What is more - the SybExecuteProc expects the command sent in to be in WIDECHAR format.

It seems the conversion must be done in the interface (sqlsyb32.dll).

johaplar

Re: TD-15670: Language issue with Sybase

Post by johaplar » 19 May 2011, 15:46

I'm uploading a small test application including a Sql script file for creating a table and a stored procedure. Sql.ini for both TD and Sybase are also included, but must of course be updated.

Hope this will help you too understand our problem.
You do not have the required permissions to view the files attached to this post.

johaplar

Re: TD-15670: Language issue with Sybase

Post by johaplar » 20 May 2011, 13:31

I just want to epmhasize how important this issue is for us. Alhough this is a real showstopper for us, we cannot stop upgrading as it's included in an order from our customer so we need it fixed ASAP. I understand you have many issues to deal with, but nevertheless.

An EMP for this is a must for us.

johaplar

Re: TD-15670: Language issue with Sybase

Post by johaplar » 25 May 2011, 12:57

Can I please have a status report on this? As I said this is really urgent for us.

Thanks

Jean-Marc Gemperle

Re: TD-15670: Language issue with Sybase

Post by Jean-Marc Gemperle » 25 May 2011, 15:35

Hi

Here is the bug for this issue
TD-15670
Contact your support person for updates on this issue.

JM

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ahrefs], [Ccbot] and 0 guests