UseUnicode = True connects with wrong charset

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
rdollinger
Posts: 7
Joined: Mon 26 Oct 2009 12:55

UseUnicode = True connects with wrong charset

Post by rdollinger » Wed 10 Nov 2010 15:46

Hi,

I have a DB in UTF8 and I would connect to this DB with charset UTF8. Bu I have noted in the MON$ATTACHMENTS table that, when UseUnicode is True the connection to the DB is UNICODE_FSS, when UseUnicode is False then the connection to the DB is UTF8. But in both cases it should be UTF8 when I set the charset to UTF8.

IBCConnection1.Options.charset := 'UTF8';

What's going wrong here?

Thanks for your help in advanced

bye
Robert

IBDAC 3.10.0.16
Delphi 2009

AndreyZ

Post by AndreyZ » Thu 11 Nov 2010 09:45

Hello,

This is a standard IBDAC behaviour. When the UseUnicode property is set to True, IBDAC uses the Unicode_FSS character set to work with string data. For more information please read the "Working with Unicode Character Data" topic of IBDAC Reference Manual.

rdollinger
Posts: 7
Joined: Mon 26 Oct 2009 12:55

Post by rdollinger » Fri 12 Nov 2010 08:25

Are there any plans to use UTF8 instead of UNICODE_FSS, because UNICODE_FSS is deprecated?

bye
Robert

UNICODE_FSS:
Unicode UTF-8. An old implementation that accepts malformed strings and does not enforce correct max. string length. All characters 3 bytes, no case mapping.
Superseded in Firebird 2.0 with the UTF8 character set. Deprecated.

AndreyZ

Post by AndreyZ » Fri 12 Nov 2010 08:41

We will investigate the possibility of using UTF-8 instead of the UNICODE_FSS character set in the future. As soon as we solve this question we will let you know.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 09 Dec 2010 15:40

New build of IBDAC version 3.50.0.19 is available for download now. Now the UTF8 charset is used instead of UNICODE_FSS, when TIBCConnectionOptions.UseUnicode is True and Charset is set to 'UTF8'.

mhelmstedt
Posts: 15
Joined: Thu 18 Nov 2010 11:32

Post by mhelmstedt » Fri 10 Dec 2010 15:45

With new version (3.50.0.19), an access violation occurs when opening the connection with the UseUnicode option checked.
Had to change back to 3.50.0.18 immediately.
Please fix!

AndreyZ

Post by AndreyZ » Mon 13 Dec 2010 09:06

I cannot reproduce the problem. Please make sure that you don't have any old dcu files and links to the old sources.

Fabrice
Posts: 45
Joined: Tue 07 Sep 2010 09:44

Post by Fabrice » Wed 15 Dec 2010 14:55

Hello,

When I set UseUnicode to true with an UTF8 database on Delphi 2010 pro.
I have access violation too in Devexpress (cxBDData.pas) :

Code: Select all

function TcxValueDefDBReader.GetValue(AValueDef: TcxValueDef): Variant;
var
  AField: TField;
begin
  AField := TcxDBDataField(AValueDef.LinkObject).Field;
  if Assigned(AField) then
    Result := GetFieldValue(AField) // <- AV here
  else
    Result := inherited GetValue(AValueDef);
end;
Without problem in previous version. All old .dcu has been removed.
You can test with the samples I have sent for this Thread

AndreyZ

Post by AndreyZ » Thu 16 Dec 2010 10:49

I cannot reproduce the problem. I have used your sample but the error didn't occur. Please send me a script to create and fill a table which causes the problem to andreyz*devart*com.

mhelmstedt
Posts: 15
Joined: Thu 18 Nov 2010 11:32

Post by mhelmstedt » Thu 16 Dec 2010 20:43

Reinstalled again, removed all dcu files, but the access violation remains.
During design time, the whole IDE crashes.

Using charset Unicode_fss avoids the access violation, but changing the charset is not what I want.

It's interesting that some tables can be opened, other's not.
The problem tables use the master source property, maybe it's related to that.
There are other problems with the master-detail connection, I'll open another topic for that.

AndreyZ

Post by AndreyZ » Fri 17 Dec 2010 07:57

Unfortunately, I still canot reproduce the problem.
To answer this question I need a script to create and fill a table which causes the problem. Or you can try composing a small sample to demonstrate this problem. Please send me a script or a sample to andreyz*devart*com.

mhelmstedt
Posts: 15
Joined: Thu 18 Nov 2010 11:32

Post by mhelmstedt » Mon 20 Dec 2010 09:26

Don't have the time for experiments at the moment, but could there be a problem in conjuntion with the Fast Report Components?

AndreyZ

Post by AndreyZ » Mon 20 Dec 2010 14:08

I've tried to reproduce this problem with FastReport Components, but there was no error.

mhelmstedt
Posts: 15
Joined: Thu 18 Nov 2010 11:32

Post by mhelmstedt » Mon 20 Dec 2010 15:47

Hi Andrey,

for further analysis I've sent you my database by mail.

Thanks in advance,
br,
Martin

AndreyZ

Post by AndreyZ » Wed 22 Dec 2010 08:32

I've opened your database with RAD Studio XE Update1 and the FastReport components without any errors. Work with the T_KUNDE table didn't cause any errors as well. Please try the following:
- remove IBDAC;
- remove all *dac*.bpl files;
- remove *.dcu files from your project;
- reinstall IBDAC.

Post Reply