String x Widestrings fields..

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
raosistemas
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 03.09.2009, 11:35
Location: Jundiaí
Contact:

String x Widestrings fields..

Post by raosistemas »

I'm converting my delphi 5 systems to delphi xe7...

when i open my projects in xe7... i have to delete all my string fields of my tzqueries and tztables fields editor... and insert again...

when i try to open, all my string fields appears:

Field descrição, expecting string, actual widestring...
There is a way to fix it?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1935
Joined: 17.01.2011, 14:17

Re: String x Widestrings fields..

Post by marsupilami »

Hello raosistemas,

this is a necessity of converting to Delphi XE7. Zeos makes use of the new possibilities and so uses TWideStingFiled instead of TStringField. This allows for the use of Unicode in your applications because as far as I understand it, TStringField still encapsulates the old AnsiString.

So - honestly there probably is no easy fix for you. Maybe you want to check if it works to just replace all TStringField declarations with TWideStringField. In that case you probably need to replace that in your dfm files too. Notpad++ or a similar editor can help with this. For using Notepad++ you need to convert your dfm files to text.

With best regards,

Jan
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: String x Widestrings fields..

Post by EgonHugeist »

As Jan suggested:

Best practice for the Unicode IDE's is to switch to TWideStringFields. You can continue using the TStringFields by setting the ControlsCodePage (TZDataSet's) to cCP_ACP. but i wouldn't do that. Delphi cast all conversioned type i.e String2Integer to a UnicodeString and does the conversion afterwards..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply