Problems with encoding

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
aleks77
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 23.04.2019, 18:08

Problems with encoding

Post 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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1999
Joined: 17.01.2011, 14:17

Re: Problems with encoding

Post 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
Post Reply