Recent

Author Topic: [SOLVED] UTF8 with zeos access and TDBEdit (Data control)  (Read 5453 times)

gelinp

  • Full Member
  • ***
  • Posts: 114
[SOLVED] UTF8 with zeos access and TDBEdit (Data control)
« on: August 18, 2016, 09:43:32 am »
Hi,

I'm using a database with UTF8 charset encoding. I find into a forum the solution to add Tzconnection property with :

Code: Pascal  [Select][+][-]
  1. codepage=UTF-8

and Lazarus add automaticaly the other property :

Code: Pascal  [Select][+][-]
  1. controls_cp=CP_UTF8

The display looks fine, specifics french characters look good with phpmyadmin (UTF8 charset) and my interface.

But now, if I want to edit database fields I use a TDBEdit control into a specific edit formula. I don't know itfdata access controls are from zeos or SQLDb components but it look like they doesn't care about UTF8. After edition with my application interface, phpmyadmin display bad characters like this into my database :

Image dans les médias

And If I refresh my application interface I can see other bad characters...

I tested to modify charset encoding to font property of TDBGrid with UNICODE, but nothing changed.

So do you have any idea to active utf8 with Data controls : TDBEdit ...

Thank you
Patrick
« Last Edit: August 18, 2016, 02:44:45 pm by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #1 on: August 18, 2016, 10:13:53 am »
Quote
My configuration is : Lazarus 1.4.4 / FPC 3.0.0 / Debian GNU/Linux 8 (jessie)

Please update to Lazarus 1.6.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #2 on: August 18, 2016, 01:23:32 pm »
OK, I upgraded to lazarus 1.6RC2. Also I removed ~/.lazarus directory and I resintalled zeos compents. I cleaned and rebuilded all lazarus environment then my project.

The problem is next than old version : My application interface display well formed characters but my sql database still display not suited utf8 characters !

You can see bad charcaters with phpmyadmin screencast linked to this response. I verified all my database table are utf8 charset with utf8_general_ci intercalsment. Also server mysql is utf8 by default with PhpMyAdmin interface...

TZconnection (zeos component) use property :
Code: Pascal  [Select][+][-]
  1. codepage=UTF-8
  2. controls_cp=CP_UTF8

All TDBEdit components use DEFAULT_CHARSET into Font charset property from object inspector. I tested with UNICODE but nothing changed...
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

Thaddy

  • Hero Member
  • *****
  • Posts: 14358
  • Sensorship about opinions does not belong here.
Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #3 on: August 18, 2016, 01:26:46 pm »
You updated tp RC2? Plz do what Juha says and update to the release..... OMG O:-)
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #4 on: August 18, 2016, 02:12:55 pm »
Ok, Ok, now I'm with lazarus 1.6, and zeos component 7.1.4 (stable release) : same problem with lazarus 1.6RC2, and lazarus 1.7 !

Note :  a lot of dublicates units compiling my project (see screencast attached). It looks lazarus try to compile source code of component attached to the project and it find a same already compiled unit from same component compiled at install time to lazarus environment...
« Last Edit: August 18, 2016, 02:17:48 pm by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

balazsszekely

  • Guest
Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #5 on: August 18, 2016, 02:26:36 pm »
Quote
codepage=UTF-8
Shouldn't be codepage=UTF8?

gelinp

  • Full Member
  • ***
  • Posts: 114
[solved] Re: UTF8 with zeos access and TDBEdit (Data control)
« Reply #6 on: August 18, 2016, 02:44:27 pm »
it is  ! Thanks a lot, I was looking for yersturday... So the correct solution is to add TZconnection property:
Code: Pascal  [Select][+][-]
  1. codepage=UTF8
  2. controls_cp=CP_UTF8

And use DEFAULT_CHARSET to all font charset property.

Thanks again. Now all is fine  :D
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

 

TinyPortal © 2005-2018