RAD Studio VCL Reference
TDataSet.Translate Method

Implements a virtual procedure to copy a data string from a source to a destination, optionally performing character translation during the copy.

function Translate(Src: PAnsiChar; Dest: PAnsiChar; ToOem: Boolean): Integer; virtual;
virtual __fastcall int Translate(PAnsiChar Src, PAnsiChar Dest, Boolean ToOem);

As implemented by TDataSet, Translate copies a source string to a destination string, and ignores the value passed in ToOem. Translate provides a fallback method for derived dataset objects that do not reimplement Translate. 

In BDE-enabled datasets, Translate converts the source string from ANSI (the native character mapping for the VCL) to OEM (the native character mapping for the BDE) when ToOem is true, and reverses that translation when ToOem is false.  

Custom datasets can use Translate to convert strings between ANSI UTF-8 (the native character mapping for dataset components) and any character mapping used by the underlying data access mechanism. When ToOem is true, Translate converts from ANSI to the underlying data access mapping. When ToOem is false, Translate reverses that conversion. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!