![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
![]() |
Wed, Apr 6 2016 11:18 AM | Permanent Link |
Matthew Jones | Using the TWriter to serialise properties, it incorrectly quotes the
strings in properties. If I type in the line: Hello " Mum Then it appears in the JSON as: "propertyname": "Hello "" Mum", It should be: "propertyname": "Hello \" Mum", When read back in, the TReader barfs on this. The problem appears to be here: procedure TWriter.StringValue(const Value: String); begin Append(QuotedStr(Value,DOUBLE_QUOTE)); end; I was going to say that should be BACKSLASH, but the QuotedStr doesn't look for one and prefix another, so bigger issue to code around than a single change. -- Matthew Jones |
Thu, Apr 7 2016 4:53 AM | Permanent Link |
Matthew Jones | Matthew Jones wrote:
> The problem appears to be here: > > procedure TWriter.StringValue(const Value: String); > begin > Append(QuotedStr(Value,DOUBLE_QUOTE)); > end; > > I was going to say that should be BACKSLASH, but the QuotedStr doesn't > look for one and prefix another, so bigger issue to code around than a > single change. Another offline thought - this must already exist - and it does. It should be calling "EscapeStr" and not "QuotedStr" here. -- Matthew Jones |
Thu, Apr 7 2016 7:47 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
<< Another offline thought - this must already exist - and it does. It should be calling "EscapeStr" and not "QuotedStr" here. >> Got it, thanks. Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 7 2016 8:09 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
Actually, after looking at this - it should be calling *both*. Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 7 2016 8:13 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
Nix that, it should look like this: procedure TWriter.StringValue(const Value: String); begin Append(DOUBLE_QUOTE+EscapeStr(Value)+DOUBLE_QUOTE); end; Tim Young Elevate Software www.elevatesoft.com |
Thu, Apr 7 2016 2:29 PM | Permanent Link |
Matthew Jones | Tim Young [Elevate Software] <timyoung@elevatesoft.com> wrote:
> Matthew, > > Actually, after looking at this - it should be calling *both*. > I hacked mine to build up an escaped string with double quotes. I don't think it should double up the quotes as well as escaping. I'm sure you know this though. -- Matthew Jones |
Thu, Apr 7 2016 2:29 PM | Permanent Link |
Matthew Jones | Tim Young [Elevate Software] <timyoung@elevatesoft.com> wrote:
> Matthew, > > Nix that, it should look like this: > > procedure TWriter.StringValue(const Value: String); > begin > Append(DOUBLE_QUOTE+EscapeStr(Value)+DOUBLE_QUOTE); > end; > > I should read fully. You match mine. -- Matthew Jones |
This web page was last updated on Monday, September 25, 2023 at 03:00 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |