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);
|
||||
if (bom and $BFBBEF) = $BFBBEF then
|
||||
loader.Position:= 3
|
||||
else if bom = $FFFE0000 then
|
||||
loader.Position:= 4
|
||||
else if bom = $FEFF then
|
||||
loader.Position:= 4
|
||||
else if (bom and $FEFF) = $FEFF then
|
||||
loader.Position:= 2
|
||||
else if (bom and $FFFE) = $FFFE then
|
||||
loader.Position:= 2
|
||||
else if (bom = $FFFE0000) or (bom = $FEFF) then
|
||||
begin
|
||||
// UCS-4 LE/BE not handled by DUB
|
||||
loader.clear;
|
||||
loader.WriteByte(byte('{'));
|
||||
loader.WriteByte(byte('}'));
|
||||
loader.Position:= 0;
|
||||
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
|
||||
loader.Position:= 0;
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue