Byte-Strings for Delphi 10 Seattle’s mobile compilers

By | September 1, 2015

Delphi’s NextGen compilers (Android, IOS) removed support for UTF8String, AnsiString and RawByteString. But if you look into System.pas you see that those types are still there but Embarcadero makes them inaccessible from outside of System.pas by prefixing them with an underscore that the compiler converts to the at-sign. And you can’t write “@UTF8String” as it is not a valid identifier.

By patching DCU files it is possible to make those hidden types accessible. And guess what, the compiler generates correct code for the “unsupported” strings.

The unit System.ByteStrings reintroduces:

  • ShortString
  • AnsiString
  • AnsiChar
  • PAnsiChar
  • PPAnsiChar
  • UTF8String
  • PUTF8String
  • RawByteString
  • PRawByteString

Usage:
Add the System.ByteStrings.dcu’s path to the compiler’s search path and add the unit to your uses clauses.

There is no *.PAS file because the DCU is patched with a hex editor to get access to the hidden types.

Name IDE Version File Size Downloads Added
System.ByteStrings XE5 RTM/UP1 only XE5ByteStrings.7z 2.45 KB 1577 times 2013-10-23
System.ByteStrings XE5 UP2 only XE5Up2ByteStrings.7z 2.85 KB 1503 times 2013-12-20
System.ByteStrings XE6 XE6ByteStrings.7z 2.89 KB 1336 times 2014-04-16
System.ByteStrings XE7 XE7ByteStrings.7z 2.89 KB 1666 times 2015-01-20
System.ByteStrings XE8 XE8ByteStrings.7z 3.69 KB 1723 times 2015-04-16
System.ByteStrings 10 Seattle D10ByteStrings.7z 3.67 KB 1905 times 2015-09-01
System.ByteStrings 10.1 Berlin D101ByteStrings.7z 3.72 KB 2375 times 2016-05-31

2 thoughts on “Byte-Strings for Delphi 10 Seattle’s mobile compilers

  1. David

    You are a legend Andy.

    We too are interested in whether there are plans for an IDEFixPack for Delphi 10 Seattle. We’ve installed it for testing purposes and out of the box compilation speed is a joke. We recall similar problems with XE7 which went away with the XE7 IDEFixPack so we live in hope… ;-).

Comments are closed.