We have large commercial app that we want to convert from Delphi 6 to 2010. Approx 10 3rd party component sets, all with source code... I have heard warnings about Unicode with 2010 - Does anyone have experience and or suggestions?
i've been in the same circumstance recently. you mostly need to pay attention to the "edges" of the app. INI files, file I/O, log files, etc. win API calls from delphi work since they've now connected the unicode API calls instead. check each 3rd party component set to make sure they're at least ready for Delphi 2009...better yet 2010. even my use of databases simply wasn't an issue...nearly everything worked right away. it just wasn't a big deal. anything that relies on the size of a character should be reviewed.
really the transition of most concern is 2007_or_earlier --> 2009_or_later.
there are plenty of discussions/blog entries about it. you could read, read, read...or you could get started & see what happens. (i did some of both). i'm sure there are "stack overflow" issues discussing your question. i'm not pretending to give a detailed description of what could happen.
it's simply not as scary as it sounds.
There are many resources available that you can read and that you will assist in the migration from Delphi 6 to Delphi 2009/2010 (Unicode).
You can use these articles as a guide.
- Unicode Migration Statistics Tool (This utility will hopefully assist you in collecting useful statistics on how hard (or not) it would be to migrate your older applications to Unicode.)
- Delphi 2009 and Unicode
- Delphi 2009 strings explained by example
- Upgrading a major project to Delphi 2009
- Delphi and Unicode
- Dr. Bob Delphi 2009 Unicode
- Delphi 2009 - Unicode in Type Libraries
- On Strings and Unicode in Delphi 2009
- Delphi in a Unicode World Part I: What is Unicode, Why do you need it, and How do you work with it in Delphi?
- Delphi in a Unicode World Part II: New RTL Features and Classes to Support Unicode
- Delphi in a Unicode World Part III: Unicodifying Your Code
- CodeRage 4 : Using Unicode and Other Encodings in your Programs
Bye.
Approx 10 3rd party component sets, all with source code.
One thing I'd add is if the component doesn't support Delphi 2009/2010, don't try to upgrade it by hacking the code.
Following is what I posted on How do the new string types work in Delphi 2009/2010?:
See Delphi and Unicode, a white paper written by Marco Cantù and I guess The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!), written by Joel.
One pitfall is that the default Win32 API call has been mapped to use the W (wide string) version instead of the A (ANSI) version, for example
ShellExecuteA
If your code is doing tricky pointer code assuming internal layout ofAnsiString
, it will break. A fallback is to substitutePChar
withPAnsiChar
,Char
withAnsiChar
,string
withAnsiString
, and append A at the end of Win32 API call for that portion of code. After the code actually compiles and runs normally, you could refactor your code to usestring
(UnicodeString
).