# JSON processing issue

**URL:** https://talk.remobjects.com/t/json-processing-issue/14779
**Category:** Remoting SDK
**Tags:** delphi
**Created:** [November 13, 2017, 2:21pm UTC](https://talk.remobjects.com/t/json-processing-issue/14779 "2017-11-13T14:21:38Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![bnx2012](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bnx2012](https://talk.remobjects.com/u/bnx2012)
#### Post date: [November 14, 2017, 9:15am UTC](https://talk.remobjects.com/t/json-processing-issue/14779/7 "2017-11-14T09:15:53Z")

</div>

Okay, I found your real bug.

```
procedure WriteString(AStream: TStream; AValue: JSON_String); 

// snip
var 
 i,j: integer; 
 s: string; 
begin 
 WriteChar(AStream, '"'); 
 for i := _StrLow to _StrHigh(AValue) do begin 
   case ord(AValue[i]) of 
     22 {"} : WriteTag('"'); 
     92 {\} : WriteTag('\'); 

```

Okay, this is the wrong part. The 22 is the HEX version of the double-quote, and the Ordinal Decimal should be 34. So what is happening is that the code is converting the wrong character. I presume that the read is then wrong too. But fixing the read is breaking the rest of the code.

---

_[View the full topic](https://talk.remobjects.com/t/json-processing-issue/14779)._
