Recent

Author Topic: [SOLVED] Character set problem with TZConnection component and Firebird  (Read 218 times)

Ever

  • Jr. Member
  • **
  • Posts: 82
Greetings

I have a Firebird 3 database whose character set is ISO8859_1. I am trying to connect to it using the ZeosLib version 8 libraries. My Lazarus version is 3.0 64-bit.

The configuration I have for the TZConnection component in the properties is as follows:

ClientCodePage=ISO8859_1
ControlsCodePage=cCP_UTF8
RawCharacterTransliterateOptions
      Encoding=encDB_CP
      Fields=True
      Params=False
      SQL=False
Properties
      AutoEncodeStrings=True
      codepage=ISO8859_1
      RawStringEncoding=DB_CP

When I save information with Latin characters, such as accented words (e.g., "crédito"), it doesn't work correctly, as it stores strange characters (e.g., "crédito").

I need help configuring the component correctly to avoid this error.

Thank you in advance.
« Last Edit: June 22, 2026, 05:08:13 pm by Ever »

jcmontherock

  • Sr. Member
  • ****
  • Posts: 360
Re: Character set problem with TZConnection component and Firebird
« Reply #1 on: June 22, 2026, 04:56:32 pm »
Your string ("crédito") is "crédit" in utf-8 encoding non converted to iso-8859-1 (Latin-1).
Windows 11 UTF8-64 - Lazarus 4.8-64 - FPC 3.2.2

Ever

  • Jr. Member
  • **
  • Posts: 82
Re: Character set problem with TZConnection component and Firebird
« Reply #2 on: June 22, 2026, 05:07:54 pm »
I've managed to solve the problem. I configured the component as follows:
ClientCodePage=UTF8
ControlsCodePage=cCP_UTF8
RawCharacterTransliterateOptions
   Encoding=encDB_CP
   Fields=True 
   Params=False
   SQL=False
Properties
   AutoEncodeStrings=True
   codepage=UTF8
   RawStringEncoding=DB_CP

In other words, in Lazarus everything is in UTF-8, and Firebird handles the conversion when saving the data. When trying to perform the conversion from within the component, Firebird was converting it again and generating garbage. With the configuration I've set up, the data arrives clean in UTF-8, and when Firebird sees that the database character set is ISO8859_1, it performs the conversion and therefore saves the data without garbage.

 

TinyPortal © 2005-2018