Page 1 of 1

Problems with encoding

Posted: 23.04.2019, 18:35
by aleks77
Hello!

Delphi 7 is my IDE.
I use zeos 7.2.4 stable to connet Sybase ASE 12.5 by 'FreeTDS_Sybase-10+'

My database string columns encode cp866 ("rus for dos")
Client use encode cp1251 ("rus for windows")

My settings for connection:

Code: Select all

  object ZConnection1: TZConnection
    ControlsCodePage = cGET_ACP
    AutoEncodeStrings = False/True (no matter)
    ClientCodepage = 'cp1251'
    Properties.Strings = (
      'codepage=cp1251'
      'controls_cp=GET_ACP')
...
    Protocol = 'FreeTDS_Sybase-10+'
but no decode apply.

When I use another driver (Protocol = 'sybase') evrything is ok.

Code: Select all

  object ZConnection2: TZConnection
    ControlsCodePage = cGET_ACP
    AutoEncodeStrings = False
    ClientCodepage = 'cp1251'
    Properties.Strings = (
      'codepage=cp1251'
      'controls_cp=GET_ACP')
...
    Protocol = 'sybase'
Is there a way to make Protocol = 'FreeTDS_Sybase-10+' do the same for me.

Thanks for any help

Re: Problems with encoding

Posted: 25.04.2019, 08:42
by marsupilami
Hello Aleks,

it might be the best idea to stick to the sybase driver. It uses the dblib provided by sybase. I am not sure if using FreeTDS brings any improvements for you.

If you still want to use freetds there are two things to consider:
  • you need to make sure that it was compiled using an iconv library. Otherwise freetds will use an internal iconv implementation which only supports Unicode (UTF8/UTF16) and ISO8859-1.
  • If you have a freetds library which includes iconv, you still need to know the name of the codepage in the iconv implementation. My Linux suggests that the name will be CP1251 or WINDOWS-1251.
Best regards,

Jan