Recent

Author Topic: UTF8 encoding  (Read 8024 times)

flori

  • Full Member
  • ***
  • Posts: 196
UTF8 encoding
« on: April 26, 2018, 08:12:04 am »
Dear friends!

I have a little program which use ZConnection, ZQuery, datasource, ZUpdate, etc. Database: Firebird 2.5. When we try to upload special characters for example: ű, ő, ű, etc we get the ''MaghÃvelyes'' mixed letters.
 
I set ZConnection ControlscCodePage:  cCP_UTF8.
 
Any help would greatly be appreciated.
Many Thanks,
Florian
« Last Edit: April 26, 2018, 08:16:15 am by flori »

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #1 on: April 26, 2018, 08:42:48 am »
Did you set the appropriate charset(UTF8) for each varchar field in the table?

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #2 on: April 26, 2018, 08:47:42 am »
yes.
 I use IBexpert. After database registration I set charset UTF8 and I try to set ZConnection properties:
codepage=
controls_cp=CP_UTF8

but still i get mixed characters....

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #3 on: April 26, 2018, 08:53:30 am »
Quote
I use IBexpert.
Good. Excellent program!

Quote
I set charset UTF8 and I try to set ZConnection properties:
Try the charset for the table, as in the attached image.


flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #4 on: April 26, 2018, 09:16:17 am »
yes i set UTF8 there. but still mixed.

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #5 on: April 26, 2018, 09:17:17 am »
Try to write "hagyományos gyümölcsös alma"  :) i think you get mixed characters :)

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #6 on: April 26, 2018, 09:36:36 am »
@flori
Please do the following:
1. Go to ZConnection --> Properties, then add the following: "codepage=UTF8" without the quote
2. Remove any other codepage settings from your code
3. Modify table charset with IBExpert
4. Add the following record: "hagyományos almából keszített minőségi pálinka"

This will work 100%.

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #7 on: April 26, 2018, 11:52:13 am »
@GetMem
Yes I wrote ZConnection - properites codepage=UFT8 then changed with IBExpert and add "hagyományos almából keszített minőségi pálinka" :)
but I still get mixed.
I have attached sample programs.
When I try import excel to dbgrid I always get mixed characters. When I try without import but still not good. :S

please check if you know:
https://1drv.ms/f/s!AqVsnEe7He7Ngvx-f1SaPY7fnJMJqg

Many thanks

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #8 on: April 26, 2018, 11:55:56 am »
So..
''hagyományos almából keszített minőségi pálinka'' work perfect but ''Hagyományos gyümölcsös kajszi'' not work :S
I do not understand
« Last Edit: April 26, 2018, 12:16:06 pm by flori »

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #9 on: April 26, 2018, 01:31:03 pm »
@flori

It works fine here. Please attach another "tablak.xlsx" with more problematic names. Add at least 5-6 so I can test. Use the Attachments and other options, below this textbox.

PS: I modified your project, you use a lot of absolute path which is wrong.

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #10 on: April 26, 2018, 01:45:09 pm »
ok. Yes I use absolute path because this is the test project.

Problematic names:. https://1drv.ms/f/s!AqVsnEe7He7Ngv0A3EcnsORvrFHo-Q
 It does not work for me...

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #11 on: April 26, 2018, 01:56:43 pm »
Please test: https://drive.google.com/file/d/1tGYNK1iyCux4KUp-WUHnfys1kUExCQ94/view
The database, xlsx files are located in the data sub folder.

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #12 on: April 26, 2018, 02:14:03 pm »
ok. Thank you. But I get same problem... :( 8-)

balazsszekely

  • Guest
Re: UTF8 encoding
« Reply #13 on: April 26, 2018, 02:15:03 pm »
What is your Lazarus/FPC version?

flori

  • Full Member
  • ***
  • Posts: 196
Re: UTF8 encoding
« Reply #14 on: April 26, 2018, 02:21:26 pm »
I use lazarus-1.8.2-fpc-3.0.4 and you?

 

TinyPortal © 2005-2018