Page 8 of 44

Posted: 17.05.2012, 15:40
by EgonHugeist
kelvinyip,

i've checked your example. Result is attached @pm. But i don't know anything about XE2 Update4. Do we expect differences here?
Can you show me what your results are?

Your example works perfectly.... I also compared the chinese characters with MySQLWorkbech. Everything is fine.

Michael

Posted: 18.05.2012, 11:00
by kelvinyip
Finally, I noticed that I can successfully insert all characters when I change the "Language for Non-Unicode Programs" from Chinese to English. That was strange.

Anyone have ideas ?

Posted: 18.05.2012, 20:52
by markus
Hi all,
i've encountered problem with Zeos encoding utf8 strings.
Image
two visible rows are added with the same exe, more even in the same session.
both should be "ąę" values, but first one have broken encoding.
What is most surprising, i cannot reproduce this error wit certain pattern. Sometimes it is ok and sometimes it's bad.
Moreover, sometimes (also without a pattern) i get error:
Image

i'm working with Postgresql 9.0 and zeos revision 1293.

Regards,
Marek

Posted: 18.05.2012, 21:02
by EgonHugeist
markus,

"sometimes" is strange. But i will check this, Marek.

Michael

Posted: 18.05.2012, 21:05
by markus
i know it's strange - i've been trying to get solid reproduction pattern since yesterday - with no effect.

Posted: 18.05.2012, 21:27
by miab3
@EgonHugeist

Simple Firebird 2.5(Win) application with table(from AnyDAC test) and dbgrid, working only when compiling on not unicode Delphi 2006.

The same application compiling on DXE2 32 and 64 bits
and on Lazarus/fpc for Window 32 and 64, freeze or destroys data.

Michal Abramczyk

Posted: 18.05.2012, 22:21
by ism
Ansi string length and UTF8 string length can be different. Potentially this may result to crash

Posted: 18.05.2012, 22:40
by EgonHugeist
@ism,
that's my thought too. I know in MySQL TZField.Size = DatabaseField.Size * 3. This MMVisual showd me. And Mark told me that this was done exacly because of the multible byte size of the encoded chars.

@miab3,
I'll check this tomorrow. Thank you for that hint. The Blob's aren't the problem here. i think the tbinary VARCHAR is the trouble-maker.

@markus,
what can i say? Nothing to find. But while debugging Zeos sometimes i had the strange behavior that a function like AString := String(UTF8Encode(AUnicodeString/AWideString)); returns a non encoded result. Which means AString = AUnicodeString; That could be a possible reason for the ascendend chars and also for the wrong-byte encoding.
Now i've introduced a GetEscapeString(const Value: PAnsiChar): String; function. Here i can be 100% sure the a real encoded UTF8String is comming in and the Result is a valid String-Cast. This is done for PostgreSQL, MySQL, SQLite. I hope this strange random issue is gone now.

Rev. 1296

Michael

Posted: 18.05.2012, 22:49
by ism
Ups, not compile

Code: Select all

DriverManager.LogMessage(lcConnect, PlainDriver.GetProtocol, LogMessage);

  LogMessage := 'set textlimit=2147483647';
  if GetPlainDriver.dbsetopt(FHandle, GetPlainDriver.GetVariables.dboptions[Z_TEXTSIZE] , '2147483647') <> DBSUCCEED then <--------------------
    CheckDBLibError(lcConnect, LogMessage);
  DriverManager.LogMessage(lcConnect, PlainDriver.GetProtocol, LogMessage);     
/testing-egonhugeist/src/dbc/ZDbcDbLib.pas(417,54) Error: identifier idents no member "GetVariables"
/testing-egonhugeist/src/dbc/ZDbcDbLib.pas(417,87) Error: Identifier not found "Z_TEXTSIZE"
/testing-egonhugeist/src/dbc/ZDbcDbLib.pas(750) Fatal: There were 2 errors compiling module, stopping

Posted: 18.05.2012, 22:51
by EgonHugeist
ism,
[s]
shit, patch comes in 10min.[/s] I was writing on the FreeTDS Driver...

Done Rev. 1297
Michael

Posted: 18.05.2012, 23:01
by ism
All compiled, thanks

Posted: 20.05.2012, 11:46
by miab3
@EgonHugeist

It seems that it is almost good(rev 1297).
In cursory testing, in principle, everything works except for the conversion of TIME in the DBGrid (and maybe DATETIME in Lazarus / fpc for Windows and Firebird 2.5).

I add corrected packages for XE2.

Michal Abramczyk

Posted: 20.05.2012, 17:17
by EgonHugeist
miab3,

this are good news. But actually i'm bussy with other things. I had no time to check this time values and you interbase issues. But i added it to my todo list. Do you have some suitable results eventually?

Michael what's wrong with the XE2 packages again? Why do you attach them again? Did i something wrong?

Michael

Posted: 20.05.2012, 17:40
by miab3
@EgonHugeist

Fixed placement of modules in dpk and strengthened the DEBUG options.

Mchal Abramczyk

Posted: 20.05.2012, 17:58
by EgonHugeist
@miab3,

ok, patch done Rev. 1299

Next thing concering these wrong time values:
If you enter 1:1 or 1-1 what do you expect now?

I can't judge if the 1:1 is one hour and one minute or one minute and one second. What is right and what is wrong? The same behavior for the date values..

How do the other components solve this issue?

Michael