mirror of https://gitlab.com/basile.b/dexed.git
only handle ANSI and UTF-8 encoede dub project
- UCS 2/4 crashes te parser - DUB itself does not support these encodings
This commit is contained in:
parent
d8cde2ecf2
commit
da958707dd
|
|
@ -164,14 +164,22 @@ begin
|
||||||
loader.Read(bom, 4);
|
loader.Read(bom, 4);
|
||||||
if (bom and $BFBBEF) = $BFBBEF then
|
if (bom and $BFBBEF) = $BFBBEF then
|
||||||
loader.Position:= 3
|
loader.Position:= 3
|
||||||
else if bom = $FFFE0000 then
|
else if (bom = $FFFE0000) or (bom = $FEFF) then
|
||||||
loader.Position:= 4
|
begin
|
||||||
else if bom = $FEFF then
|
// UCS-4 LE/BE not handled by DUB
|
||||||
loader.Position:= 4
|
loader.clear;
|
||||||
else if (bom and $FEFF) = $FEFF then
|
loader.WriteByte(byte('{'));
|
||||||
loader.Position:= 2
|
loader.WriteByte(byte('}'));
|
||||||
else if (bom and $FFFE) = $FFFE then
|
loader.Position:= 0;
|
||||||
loader.Position:= 2
|
end
|
||||||
|
else if ((bom and $FEFF) = $FEFF) or ((bom and $FFFE) = $FFFE) then
|
||||||
|
begin
|
||||||
|
// UCS-2 LE/BE not handled by DUB
|
||||||
|
loader.clear;
|
||||||
|
loader.WriteByte(byte('{'));
|
||||||
|
loader.WriteByte(byte('}'));
|
||||||
|
loader.Position:= 0;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
loader.Position:= 0;
|
loader.Position:= 0;
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue