Delphi 2007 and Delphi 2009+ difference in string types. Migration

CodeGear Delphi 2007

This is not a divine revelation, but simply semblance of my personal reference.

In Delphi 2007AnsiString was the default string type used for general-purpose string manipulation.
This means variables declared simply as string were compiled as AnsiString. This changed in Delphi 2009+, where string became an alias for UnicodeString.

AnsiString in Delphi 2007:
  • In Delphi 2007 Char was an 8-bit (1-byte) AnsiChar, while in Delphi 2009+, it became a 16-bit WideChar (UTF-16) by default.
  • Encoding: The interpretation of these bytes depends on the operating system's current active code page (e.g., Windows-1252, or specific locales like code page 936 for simplified Chinese).
  • Length: AnsiString was dynamically allocated and limited only by available memory, unlike the older ShortString that was limited to 255 characters.
The primary distinction in Delphi 2009 and later is the shift to Unicode.
  • Char now represents a 16-bit character, enabling full Unicode support. Char becomes WideChar
  • string is an alias for UnicodeString (UTF-16, 2 bytes per character).
  • AnsiString still exists but is used primarily for backward compatibility or interfacing with non-Unicode systems/APIs.
When moving from Delphi 2007 to Delphi 2009 (or later):
  • AnsiString to UnicodeString: String changes, leading to potential data loss if ANSI data is assigned directly to Unicode strings.
  • Explicit Casts: Use PAnsiChar(myWideString), AnsiString(myUnicodeString) and similar, where needed, and be aware of character mapping.
  • Migration Required: Code using Char, PChar needed updates, especially with assignments between ANSI and Unicode types.
  • If a 1-byte buffer is in need, use RawByteString instead of string or Char. RawByteString is AnsiString with no code page set by default (AnsiString($ffff)).
(e.g., #128 isn't the Euro sign in Unicode).
Delphi and Unicode, Marco Cantù, December 2008

Python uses a short circuit technique

Python logo
It turns out that Python uses a short circuit technique as soon as the final result is determined.

Delphi/Object Pascal is in 8th position on tiobe.com TOP10 list of programming languages for November 2025

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular web sites Google, Amazon, Wikipedia, Bing and more than 20 others are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written. The index can be used to check whether your programming skills are still up to date or to make a strategic decision about what programming language should be adopted when starting to build a new software system.
Delphi/Object Pascal is in the 8th position on the tiobe.com TOP10 list of programming languages for November 2025

TIOBE index

How to Stop The Annoying Update Prompts from NIK collection?

The Annoying Update Prompts from NIK collection
To stop update checks off from configuration file, XML, which is soon of all located here:
C:\ProgramData\DxO\Nik Collection\NikCollection.cfg
Find the following section:
<group name="Checkforupdate"> <key name="LastCheck" type="string" value="1634475377"/> </group>
add
<key name="IsEnabled" type="bool" value="0"/>
and never have the annoying message again.

Pygame 2.6.1 not installing on Python 3.14.0

Python logo
Installing pygame (version 2.6.1) gives an error that metadata doesn’t work.
A wheel is not released for 3.14 yet. This is not a bug in CPython.
As a temporary measure I rolled back to the previous version Python 3.13.

pygame-ce is a drop-in fork by most of the original development team already has a version for 3.14.