#1 2013-10-25 08:35:32

畅雨
Member
Registered: 2013-10-24
Posts: 29

mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

Test : mssql server2012 + syndbZEOS : If fieldname has  some Asian languages(Double-byte characters) then error,
but oledb,firedac,sqlite3 is correct .

eg: SQL= select  'changyu畅雨' as 姓名   , the result : [{"濮撳悕":"changyu畅雨"}]      , remark: '姓名' = 'name'

The fieldname is wrong, but  fieldvalue is correct !   

 SynDBZEOS.pas  line 544
  ...
  for i := 1 to fResultInfo.GetColumnCount do begin
      name := (fResultInfo.GetColumnLabel(i));    -----maybe has error?
      if name='' then
        name := (fResultInfo.GetColumnName(i));  -----maybe has error?
  ...

But I do not know how to fix it   ...   sad

Last edited by 畅雨 (2013-10-25 08:40:27)

Offline

#2 2013-10-25 11:54:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

Which version of Delphi are you using?
Which version of Zeos/ZDBC?
Did you try with another DB backend?

Offline

#3 2013-10-25 12:00:33

畅雨
Member
Registered: 2013-10-24
Posts: 29

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

delphi7, zeos: 7.1.2

Offline

#4 2013-10-25 12:03:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

We did test only English-based column names, since our ORM and our own code style expect this behavior...

The SynDBZeos unit code uses a plain "name: string" variable, then StringToUTF8() to make the conversion...
Could you step in those lines using the debugger, and check the "name: string" content?

Offline

#5 2013-10-25 12:17:05

畅雨
Member
Registered: 2013-10-24
Posts: 29

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

OK,  I try

Offline

#6 2013-10-25 12:19:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

It may be a ZEOS/ZDBC problem under Delphi 7.

Or perhaps the returned "AnsiString" is UTF-8 encoded in non Unicode Delphi versions...

Offline

#7 2013-10-25 12:26:35

畅雨
Member
Registered: 2013-10-24
Posts: 29

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

SynDBZEOS.pas  line 548
  ...
      PSQLDBColumnProperty(fColumn.AddAndMakeUniqueName(StringToUTF8(name)))^.
  ...
replace as:
      PSQLDBColumnProperty(fColumn.AddAndMakeUniqueName(name))^.

  remove  StringToUTF8 , result is correct !
 
I guess Coding has been processed by zeos, the returned 'name' is UTF-8 encoded?

Last edited by 畅雨 (2013-10-25 12:30:15)

Offline

#8 2013-10-25 13:20:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: mssql server2012 + syndbZEOS : If fieldname has some Asian languages(

I guess this is for non-Unicode Delphi only... sad

Should be fixed by http://synopse.info/fossil/info/405d06b156

Offline

Board footer

Powered by FluxBB