unicode glitch in all 7.x versions. (tdblookupcombobox)

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
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

unicode glitch in all 7.x versions. (tdblookupcombobox)

Post by marcov »

Is it known that tdblookupcombobox has unicode related glitches with Zeos? Or should one always use multiple datasources in such cases?

Delphi version: Delphi XE3 (so should be fully unicode).
database : postgres 9.x client_encoding=utf8 in connection properties.
Zeos versions tested: 7.0.x,7.1.x, and trunk all suffer.

Basic setup:

- one dataset and tzquery in a datamodule (meant to be listsource of the tdblookupcombobox)
- two frames (each on a tab of a pagecontrol) both with a tdblookupcombobox each wired to the above datasource.

The combobox that is enabled the second time has unicode glitches. Characters not in the current (ascii) codepage are mutilated (probably some utf8->ansi->utf8 conversion)

wokraround: The problem goes away by adding another tdatasource to the same dataset (so that every lookup has its own datasource)
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: unicode glitch in all 7.x versions. (tdblookupcombobox)

Post by EgonHugeist »

Marco,

have no XE3. With older IDE's i can't reproduce it.
What i did:

Add a TDataSource as ListSource to my test-formular, link this Component agains a test table.
Add one tdblookupcombobox to a TTabSheet of a TPageControl. And a second to a second TTabSheet.

than assign props as this for the Test:

Code: Select all

      object DBLookupComboBox1: TDBLookupComboBox
        Left = 405
        Top = 20
        Width = 145
        Height = 23
        DataField = 'p_name'
        DataSource = DSTUnicode
        KeyField = 'p_name'
        ListField = 'p_name'
        ListSource = DSCombo
        TabOrder = 1
      end
ZConnnection (Unicode):

Code: Select all

  object ZConUnicode: TZConnection
    ControlsCodePage = cCP_UTF16
    Properties.Strings = (
      'TimeOut=10'
      'controls_cp=CP_UTF16'
      'AutoEncodeStrings=ON')
    Connected = True
    Port = 0
    Database = 'zeoslib'
    User = 'postgres'
    Password = 'masterkey'
    Protocol = 'postgresql-9'
    Left = 88
    Top = 40
  end
What am i doing wrong to reproduce it? :?:
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Re: unicode glitch in all 7.x versions. (tdblookupcombobox)

Post by marcov »

No idea. Zconnection looks like this:

Code: Select all

 object ZConnection: TZConnection
    ControlsCodePage = cCP_UTF16
    UTF8StringsAsWideField = True
    Catalog = ''
    Properties.Strings = (
      'codepage=utf8'
      'client_encoding=utf8')
    HostName = '192.168.186.11'
    Port = 0
    Database = 'candelacrm'
    User = 'postgres'
    Password = ''
    Protocol = 'postgresql-8'
    Left = 30
    Top = 8
  end
The dataset/source combo looks like this:

Code: Select all

 object ZDepartment: TZReadOnlyQuery
    Connection = ZConnection
    SortedFields = 'bedrijfplaats'
    SQL.Strings = (
      
        'select *,(bedrijfsnaam || '#39' '#39' || plaats) AS bedrijfplaats from b' +
        'edrijven order by bedrijfplaats')
    Params = <>
    IndexFieldNames = 'bedrijfplaats Asc'
    Left = 53
    Top = 69
    object ZDepartmentid: TIntegerField
      FieldName = 'id'
      Required = True
    end
    object ZDepartmentbedrijfsnaam: TWideStringField
      FieldName = 'bedrijfsnaam'
      Size = 255
    end
    object ZDepartmenttelalg: TWideStringField
      FieldName = 'telalg'
      Size = 255
    end
    object ZDepartmentfaxnralg: TWideStringField
      FieldName = 'faxnralg'
      Size = 255
    end
    object ZDepartmentstraat_nr: TWideStringField
      FieldName = 'straat_nr'
      Size = 255
    end
    object ZDepartmentpostcode: TWideStringField
      FieldName = 'postcode'
      Size = 255
    end
    object ZDepartmentplaats: TWideStringField
      FieldName = 'plaats'
      Required = True
      Size = 255
    end
    object ZDepartmentactief: TBooleanField
      FieldName = 'actief'
    end
    object ZDepartmentprofiel: TWideMemoField
      FieldName = 'profiel'
      OnGetText = MainMemoGettext
      BlobType = ftWideMemo
    end
    object ZDepartmentland: TWideStringField
      FieldName = 'land'
      Size = 255
    end
    object ZDepartmentRelatietype: TIntegerField
      FieldName = 'Relatietype'
      Required = True
    end
    object ZDepartmentdatumtoegevoegd: TDateField
      FieldName = 'datumtoegevoegd'
    end
    object ZDepartmentoriginid: TIntegerField
      FieldName = 'originid'
    end
    object ZDepartmenturl: TWideStringField
      FieldName = 'url'
      Size = 512
    end
    object ZDepartmentbedrijfplaats: TWideMemoField
      FieldName = 'bedrijfplaats'
      ReadOnly = True
      OnGetText = MainMemoGettext
      BlobType = ftWideMemo
    end
  end
  object DSDepartment: TDataSource
    DataSet = ZDepartment
    Left = 113
    Top = 69
  end
 
Tdblookupcombobox looks like:

Code: Select all

object DBDepartment: TDBLookupComboBox
      Left = 275
      Top = 50
      Width = 326
      Height = 21
      DataField = 'bedrijfid'
      DataSource = dm_contactmain.DSPeople
      DropDownRows = 15
      KeyField = 'ID'
      ListField = 'bedrijfplaats'
      ListSource = dm_main.DSDepartment
      TabOrder = 9
    end
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: unicode glitch in all 7.x versions. (tdblookupcombobox)

Post by EgonHugeist »

What i'm doing.. I can't reproduce it. Anybody else?

Marco could you make a template app with a populate script?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply