Page 1 of 1

utf8 text field

Posted: Thu 13 Nov 2014 08:32
by andrea.m86
Hi,
I've a question about using your components for accessing text fields.
I've a database (mysql 5.6) with several text and mediumtext field which have utf8_bin as collation.
I've set in my connection the properties:
useunicode = true
charset = utf8
When i try to access, read or write those fields i've got problems with the character.
I've read some discussions about that on this forum but i didn't understand if it's possible to automatically manage those kind of fields with a dbaware component like i do with the varchar fields.

Am i doing something wrong (maybe missing some properties) or is it necessary to write some code when i read and when i write on those fields?

thanks.
Andrea

Re: utf8 text field

Posted: Thu 13 Nov 2014 13:58
by ViktorV
Please check what types your Text or MediumText data are mapped to. If to Blob - you have 2 options to solve the issue:
1. Remove the binary tag from the fields definition on the server.
2. You can map data of such columns to WideMemo. Example:

Code: Select all

MyTable.DataTypeMap.AddFieldNameRule(FieldName, ftWideMemo);
If data of your fields are mapped to WideMemo and the error is reproduced, then please send us a small sample to demonstrate the issue, including a script to create database objects.

Re: utf8 text field

Posted: Fri 14 Nov 2014 14:36
by andrea.m86
hi
Thank you for your hint.
I've solved in a little different way.
Since I always use blob fields as memo in my applications I've defined a mapping between the database blob fields and the WideMemo Field type on the connections.
Now everything work fine.
Thanks

Re: utf8 text field

Posted: Mon 17 Nov 2014 08:55
by ViktorV
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions.