There are four different string types in VCL:
|Strings Type||Data||Default String||Description||Supported|
|ShortString||Ansi||Delphi 1||Ansi string with maximum length of 255 characters||All Delphi and C++Builder versions.|
|AnsiString||Ansi||Delphi 2-2007, C++Builder 1-2007||Ansi string with no length restriction. Reference counted.||Delphi 2 and later. All C++Builder versions.|
|WideString||Unicode||-||UTF-16 string||Delphi 3 and later. All C++Builder versions.|
|UnicodeString||Unicode||Delphi 2009 and later. C++Builder 2009 and later.||UTF-16 string. Reference counted.||Delphi 2009 and later. C++Builder 2009 and later.|
In addition of these there is String alias that is mapped to one of the above strings. In Delphi 1 String was ShortString. After that it was AnsiString until Delphi 2009/C++Builder 2009 where the default string was changed to UnicodeString.
When Delphi or C++Builder compiler compiles an application and saves form data into the application resource the compiler encodes all strings. There are four different string encoding methods:
|Short string||Ansi||vaString||Ansi string with maximum length of 255 characters||All Delphi and C++Builder versions.|
|Long string||Ansi||vaLString||Ansi string with no length restriction||Delphi 2 and later. All C++Builder versions.|
|Wide string||Unicode||vaWString||UTF-16 string||Delphi 6 and later. C++Builder 6 and later.|
|UTF-8 string||Unicode||vaUTF8String||UTF-8 string||Delphi 6 and later. C++Builder 6 and later.|
In general Sisulizer uses the same encoding in localized strings as in original strings. For example if the original form is in English most strings are encoded as short string using code page 1252. Strings that are longer than 255 characters are encoded as long strings using code page 1252. If a string contains non-ASCII characters (e.g. ©, Ä or Ö) it is encoded as UTF-8 or UTF-16, whichever takes less space.
When Sisulizer writes localized forms the string value are different to the original values. Their character sets are also different. This might make Sisulizer to use Unicode much more than Ansi. Especially when you are localizing to a non-Latin based language such as Greek or Japanese. If you use Delphi/C++Builder 6 or later there are no problem. All strings encoding are valid. However if you use Delphi/C++Builder 5 or older Unicode encoding are not available for properties that has String type. There is not easy and 100% reliable way to detect what was the Delphi/C++Builder compiler that was used to compile the EXE. This is why you can configure if and how Sisulizer writes Unicode strings.
Use the Options sheet of VCL source dialog. Right click your application on the project tree and choose Properties. Options sheet contains Widestring (Unicode) usage part.
Specifies if Ansi strings are converted to Unicode strings when creating localized forms. Possible values are:
|Automatic||Ansi strings are written as Unicode strings if the original application was compiled with Unicode enabled VCL (Delphi 6 or later, C++Builder 6 or later) and it contains at least one Unicode string in its form(s).|
|No||Ansi strings are never converted to Unicode but are written as Ansi strings.|
|Yes||Ansi strings are written always as Unicode strings. Use this if you use Unicode enabled VCL (Delphi 2009 or later, C++Builder 2009 or later) or Unicode enabled components such as TNT or ElPack.|
Delphi 2009 and C++Builder 2009 and later have a Unicode enabled VCL. It means that the default string is now UnicodeString instead of AnsiString. If you localize an Unicode VCL application Sisulizer writes all strings as Unicode using either UTF-8 or UTF-16.
TNT and ElPack components provide Unicode support even when used with non-Unicode VCL. Sisulizer automatically detects that you use Unicode components and writes all strings as Unicode. Sometimes usage of Unicode components can not be detected. In that case turn Widestring (Unicode) usage to Yes.
If your application is written in Delphi 5, C++Builder 5 or older and it contains Unicode enabled components such ad TNT or ElPack and you have not turned off Unicode writing you will get the following error when you try to run your localized application:
To make you localized application to work you have to turn Widestring (Unicode) usage to No.