Page 1 of 1

String x Widestrings fields..

Posted: 21.03.2016, 19:40
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?

Re: String x Widestrings fields..

Posted: 23.03.2016, 18:28
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

Re: String x Widestrings fields..

Posted: 30.03.2016, 03:57
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..