Quantcast
Channel: Planet Object Pascal
Viewing all articles
Browse latest Browse all 1725

Andy's Blog and Tools: The Return of the Byte-Strings

$
0
0

Delphi’s NextGen compiler (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.

NameIDE VersionFileSizeDownloadsAdded
System.ByteStringsXE5XE5ByteStrings.7z2.45 KB257 times 2013-10-23

Viewing all articles
Browse latest Browse all 1725

Trending Articles