dif encoding

This commit is contained in:
SheetJS 2021-08-24 00:43:20 -04:00
parent 4638f8c118
commit bf9146d579
4 changed files with 1578 additions and 0 deletions

View File

@ -2,6 +2,7 @@
Various spreadsheet file format notes.
- [Data Interchange Format (DIF)](/dif/README.md)
- [Symbolic Link (SLK/SYLK)](/sylk/README.md)
- [XLSB Short Records](/xlsb_short_records/README.md)

31
dif/README.md Normal file
View File

@ -0,0 +1,31 @@
# Data Interchange Format
Files starting with `TABLE` followed by a newline marker followed by `0,1`
should be interpreted as DIF.
There exists a technical specification from 1983.
### Encoding
The specification includes a Pascal procedure for reading a string. There is an
error in handling double quotes:
```pascal
if str[1] = '"' { strip quotes }
then begin
delete (str, 1, 1);
delete (str, pos('"', str), length(str) - pos('"', str) + 1)
end
```
It does not correctly handle `"` characters in strings. Writers should use `""`
(similar to CSV encoding). The following DIF snippet represents `"`:
```dif
1,0
""""
```
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/notes?pixel)](https://github.com/SheetJS/notes)

1545
dif/byte.dif Executable file

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,7 @@ For example, `\x1BNj` encodes byte `0x8C`
- Bytes `0xA8`, `0xB0` and `0xB4` have space characters (` `) after the letter.
Byte `0xA8` is encoded as `\x1BNH\x20`
## Record Types
| Record Type | Description |