Skip to main content

Posts

Showing posts from December, 2019

SynEdit project TDBSynEdit fix for unicode memo fields

SynEdit is a syntax highlighting edit control for  Delphi and Kylix Symptom   Component TDBSynEdit cannot open the BLOB field of SQLite3 database if the data type is set to TEXT and UTF8 encoding . Zeos  unicode v7.2.6 components (UTF16) are used to access database SQLite3.   Source code SynDBEdit.pas (2014-10-13) Solution   Replace LoadMemo default encoder typ e Byte to Unicode 2 bytes , if data field type is Widestring. The code below tested in Delphi XE6 and 10.1   procedure TCustomDBSynEdit . LoadMemo ; {$IFDEF UNICODE} const BlobFieldWideText = [ ftWideMemo , ftWideString ] ; {$ENDIF} {$IFDEF SYN_COMPILER_3_UP} var BlobStream : TStream ; {$ELSE} var BlobStream : TBlobStream ; BlobField : TBlobField ; {$ENDIF} begin try {$IFDEF SYN_COMPILER_3_UP} BlobStream : = FDataLink . DataSet . CreateBlobStream ( FDataLink . Field , bmRead ) ; {$ELSE} BlobField : = FDataLink . Field as TBlobField ; BlobStream : =