mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
classes: add TStringsOption.soPreserveBOM
git-svn-id: trunk@43848 -
This commit is contained in:
parent
db588d64a0
commit
ee18a7ee9a
@ -610,7 +610,7 @@ type
|
||||
TStringsForEachMethod = procedure(const CurrentValue: string) of object;
|
||||
TMissingNameValueSeparatorAction = (mnvaValue,mnvaName,mnvaEmpty,mnvaError);
|
||||
TMissingNameValueSeparatorActions = set of TMissingNameValueSeparatorAction;
|
||||
TStringsOption = (soStrictDelimiter,soWriteBOM,soTrailingLineBreak,soUseLocale);
|
||||
TStringsOption = (soStrictDelimiter,soWriteBOM,soTrailingLineBreak,soUseLocale,soPreserveBOM);
|
||||
TStringsOptions = set of TStringsOption;
|
||||
|
||||
TStrings = class(TPersistent)
|
||||
|
@ -1397,6 +1397,8 @@ begin
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
if soPreserveBOM in FOptions then
|
||||
WriteBOM:=False;
|
||||
end;
|
||||
|
||||
|
||||
@ -1431,6 +1433,8 @@ begin
|
||||
SetLength(Buffer,BufLen-BufDelta+BytesRead);
|
||||
PreambleLength:=TEncoding.GetBufferEncoding(Buffer,AEncoding,FDefaultEncoding);
|
||||
T:=AEncoding.GetAnsiString(Buffer,PreambleLength,Length(Buffer)-PreambleLength);
|
||||
if soPreserveBOM in FOptions then
|
||||
WriteBOM:=PreambleLength>0;
|
||||
SetEncoding(AEncoding);
|
||||
SetLength(Buffer,0);
|
||||
SetTextStr(T);
|
||||
|
Loading…
Reference in New Issue
Block a user