System.RawByteString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

type RawByteString = AnsiString;

C++

typedef AnsiStringT<65535> RawByteString;

Properties

Type Visibility Source Unit Parent
type
typedef
public
System.pas
System.hpp
System System

Description

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.

See Also