SaveWideStringToFileWithBOMBE
SaveWideStringToFileWithBOMBE saves the string given by aContents as a file on disk named as specified by aFileName.
SaveWideStringToFileWithBOMBE handles unicode characters.
The function is similar to SaveWideStringToFileWithBOM, because the function enables the file to be saved taking byte order into account by using BOM - an acronym for Byte Order Marks.
However, this function processes by big-endian with the most-significant byte at the smallest memory address. This means that if two bytes are used, then the first byte will be pushed into memory address location 2, and the second byte will reside in memory location 1.
Pease also see SaveWideStringToFileWithBOM.
To save a file ignoring BOM, please refer to SaveWideStringToFile.
If a file with aFileName already exists, then it will be overwritten - if attributes and permissions allow. If permissions and attributes do not allow it to be overwritten, then an exception error will be encountered.
Declaration:
Procedure SaveWideStringToFileWithBOMBE(const aContents : string; const aFileName : string);
An example to save a text file that contains several unicode characters, to simply illustrate the function syntax and its use.
procedure
OnMapEvent(
var
Value:Variant);
var
vData :
string
;
begin
vData :=
'AaBbÖP€CcDd €Ö£PÆ Ajkshdsdfhl adf jalsd fj;ao sdfj ;sod;as Æ8™€çZÐ text with lots of unicode.'
;
SaveWideStringToFileWithBOMBE(vData,
'c:\Temp\BOMBETodayTestWS.txt'
);
end
;