From Appmethod Libraries
Jump to: navigation, search

Object Pascal

type RawByteString = AnsiString;


typedef AnsiStringT<65535> RawByteString;


Type Visibility Source Unit Parent
System System


Enables the passing of string data of any code page without doing any codepage conversions.

The purpose of RawByteString is to reduce the need for multiple overloads of procedures that read string data. This means that parameters of routines that process strings without regard for the string's code page should typically be of type RawByteString.

RawByteString should only be used as a parameter type, and only in routines which otherwise would need multiple overloads for AnsiStrings with different codepages. Such routines need to be written with care for the actual codepage of the string at run time.

In general, it is recommended that string processing routines should simply use "string" as the string type. Declaring variables or fields of type RawByteString should rarely, if ever, be done, because this practice can lead to undefined behavior and potential data loss.

Note: RawByteString is used by the Object Pascal desktop compilers, but is not supported by the Object Pascal mobile compilers.
For more information, see Migrating Object Pascal Code to Mobile from Desktop.

See Also