Thursday, November 20, 2008

Unicode and Delphi 2009

I must confess that when it comes to Unicode, I have buried my head in the sand and deliberately tried to ignore the whole transition mess from the English-centric ANSI based character set to the world-friendly Unicode standard.

To get a brief background on Unicode and what it means to developers, please see Joel's article. It is a good briefing on the problem that Unicode solves, and addresses the basics.

As mentioned in other programming related posts, my company's primary products are developed using Delphi 2007 for the Windows platform. One of the primary products is also supported on the Linux platform by using Free Pascal.

Recently, CodeGear released a new version of Delphi - 2009. Doing some research on the product, it appears as if they have made a fairly significant change to the language. In previous versions, the string type was an AnsiString, which means that one characters takes up one byte of memory. In the 2009 version, the string type is now mapped to a UnicodeString. Since a Unicode string can have one of several types of encoding which map one character to one or more bytes, it is possible that this change may drastically affect any legacy Delphi application which processes strings, especially if it is a library which is used by other applications.

Thankfully, CodeGear has provided developers with three articles {part 1, part 2, part 3} detailing the changes made, and gotchas to look out for when porting legacy applications over to Delphi 2009. Please take a look at these articles to see what the potential obstacles are when moving your applications over, and consider the difficulties. Third party components will most likely also need to be tweaked to work with Delphi 2009, so keep that in mind as well. You can find PBear's HTML viewer updated for Delphi 2009 here, along with other free components.

As far as Free Pascal is concerned, Unicode support and compatibility is something that they are currently hashing through. Until a Delphi 2009 Unicode compatibility mode can be implemented in Free Pascal, we will be forced to stick with Delphi 2007 for the time being.

Tuesday, November 11, 2008

The Matrix Runs Windows

Check it out here. That is all!