1

I am having an issue using Lazarus + zeos + access in some characters (Ç, ~, í ... )

The problem is a bit weird, sometimes i can insert properly, but sometimes the characters go crazy, example:

When tipping

When I am typing it is ok, the ç and ã

BUT when I exit the DBedit:

After dbedit exit

This happens sometimes, and sometimes the chars are registered just fine

Using zeos, with zeosconnection. ClientCodepage UTF8 / ControlsCodepage UTF8 / AutoEncodestrings true.

Tried to change the charset but the problem persists, and the worst thing is that sometimes it works but sometimes it seems to loose the charset...

This difference in behaviour occurs in the same run of the program. For example, I am typing, when I save a change to a record in my database, everything is fine and ok; then I try to create a new record and the problems occurs, and the funny thing is: when I type "requisição" the chars stay the same, but I proceed to type "requisição de saída" the chars break; it seen like a problem that the software is trying to auto-encode based on what I am typing.

Also, I have discovered that if I put an extra blank space after the word that has "...ção" in the end everything works as it should "requisição[][]de saída" where the [] are the two blank spaces

Any advice?

MartynA
  • 30,454
  • 4
  • 32
  • 73
  • When you say "sometimes", do you mean that you get the charset variation **in the same session** of your app, or that you get one charset in one session of the app and the other in a later session? – MartynA Mar 27 '19 at 15:12
  • in the same session i.e. i am typing, and save a register in my database, everything is fine and ok... i try to create a new record then the problems occurs, and the funny thing is: when i type "requisição" the chars stay the same.. i proceed to type "requisição de saída" the chars breaks, it seen like a problem that the software is trying to auto encode based on what i am typing. – Leonardo Floriano Mar 27 '19 at 15:41
  • I think you should edit that into your q because it is important information. Sounds like this q may need an expert in the Lazarus db-aware components. Meanwhile, do you get the same problem with a minimal project using TSqlQuery, etc, instead of Zeos? – MartynA Mar 27 '19 at 15:50
  • Yes , using access is a nightmare but it was the client choice so... And also I discover if I put an extra blank space after the word that has "...ção" in the end everything works as it should "requisição[][]de saída" where the [] are the two blank spaces – Leonardo Floriano Mar 27 '19 at 16:26
  • I have edited the extra information provided in your comments into your q. However, you might want to edit it slightly yourself to replace the expression "the chars break" with something more descriptive. – MartynA Mar 27 '19 at 19:11
  • Just for general interest: i solved the issue by adding a space after any word that has "ção" in the end, by adding the space any following special char will stay the same i.e. Í , ç , Á , õ, etc.. I think that happens because of the auto encoding provide by the Zeos Connection, it tries to find what encoding the database is using and gets it totally wrong, the special character "Ç" is root of the problem, it somehow tells the auto encoder to change the default encoding messing up the whole sentence. Thanks MartynA for your advice. – Leonardo Floriano Apr 02 '19 at 19:02
  • Well what is the db codepage for the relevant field? – Marco van de Voort Apr 28 '19 at 21:12

0 Answers0