Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Export string with CR, LF or CRLF did break the JSON #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SuperObject
 # SuperObject

## What is JSON ?

Expand Down Expand Up @@ -162,7 +162,7 @@ begin
obj.AsArray[item]
```

## RTTI & marshalling in Delphi 2010
## RTTI & marshalling in Delphi 2010

```pas
type
Expand Down
16 changes: 16 additions & 0 deletions superobject.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,22 @@ TByteChar = record
inc(pos);
start_offset := pos;
end;
#13:
begin
if(pos - start_offset > 0) then
Append(str + start_offset, pos - start_offset);
Append(ESC_CR, 2);
inc(pos);
start_offset := pos;
end;
#10:
begin
if(pos - start_offset > 0) then
Append(str + start_offset, pos - start_offset);
Append(ESC_LF, 2);
inc(pos);
start_offset := pos;
end;
else
inc(pos);
end;
Expand Down