mirror of https://gitlab.com/basile.b/dexed.git
fix, prevent a DUB json withucs-x BOM to be overwritten with a dummy structure
This commit is contained in:
parent
9a9f74149f
commit
ea9b3af4dd
|
@ -178,6 +178,7 @@ begin
|
||||||
loader.WriteByte(byte('{'));
|
loader.WriteByte(byte('{'));
|
||||||
loader.WriteByte(byte('}'));
|
loader.WriteByte(byte('}'));
|
||||||
loader.Position:= 0;
|
loader.Position:= 0;
|
||||||
|
fFilename := '';
|
||||||
end
|
end
|
||||||
else if ((bom and $FEFF) = $FEFF) or ((bom and $FFFE) = $FFFE) then
|
else if ((bom and $FEFF) = $FEFF) or ((bom and $FFFE) = $FFFE) then
|
||||||
begin
|
begin
|
||||||
|
@ -186,12 +187,13 @@ begin
|
||||||
loader.WriteByte(byte('{'));
|
loader.WriteByte(byte('{'));
|
||||||
loader.WriteByte(byte('}'));
|
loader.WriteByte(byte('}'));
|
||||||
loader.Position:= 0;
|
loader.Position:= 0;
|
||||||
|
fFilename := '';
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
loader.Position:= 0;
|
loader.Position:= 0;
|
||||||
//
|
//
|
||||||
FreeAndNil(fJSON);
|
FreeAndNil(fJSON);
|
||||||
parser := TJSONParser.Create(loader);
|
parser := TJSONParser.Create(loader, fSaveAsUtf8);
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
fJSON := parser.Parse as TJSONObject;
|
fJSON := parser.Parse as TJSONObject;
|
||||||
|
|
Loading…
Reference in New Issue