unicode - How to choose migration path from Delphi 2007 -


For a big application with Delphi 2007, I am working with a team. It uses a large heritage structure to access the data. Both apps and framework use string as strings for strings. I have started modifying the code in the framework to support the Delphi 2009 string, see my previous questions about this.

I now see 2 options:

Alt 1 - Continue to use the string as before, it is probably the safest solution because the structure After this it will support Unicode. But for this to work, the code should be modified very much in the framework. In this framework, there is a need to understand the internal algorithms in depth.

Alt 2 - Change the string around with AnsiString and AnsiChar. This is probably a very simple solution and how I am starting to modify the code (but then I started thinking and asking this question ...) There is no support for Unicode on its negative side. Unicode support is not a requirement as previously worked but it is good. It may also be useful in the future. Another problem is that the application should be formatted as the parameter in the form of the first parameter for the structure instead of the string Should send the asistic variable in There are thousands of calls to change ...

That's why I do not know. Both options require a lot of work, but Alt 1 is probably more risky and time consuming. What I want from this forum is feedback and comments because I think that I am not the first to have this problem.

Edit Another issue is the memory footprint I wrote a quick test that allocates an array of one million stars. Each string was filled with 26 characters from A to Z.

With Delphi 2007 it took 40.011.600 bytes and the time was 4:15 minutes. This was taken 72.015.580 bytes with the Delphi 2009 and the time was 4:45 minutes.

Memory consumption was measured with GetHeStats.

I do not think we can afford to assign more memory to the string twice more.

500 MB of memory consumption for every customer is no longer unusual. I think most of these are in the form of wire. Maybe we try to use as much as possible AnsiString.

Regards

Start with "Alt 2", then slowly Add Unicode support to your structure, then go to Unicode.

Argument: You want a stable app; Switching to Delphi 2009+ You will eventually need to support Unicode.

Edit : 20100125

While Delphi compiler signal warnings while doing "alt 2"
A situation that describes, produces such signs and warnings.

I have told it about me.
The link above indicates on one page, where you can see the recurrence of that session.

- jeroen

If you still have questions, leave them here.

- jeroen


Comments