#1 2015-01-17 16:54:58

berndvf
Member
Registered: 2013-03-08
Posts: 16

DocVariantData - item name uppercase.

Hi there,

I am trying to generate some JSON using DocVariant. I am using the following test app (using Delphi 6 - seems to work fine in Delphi 7):

program test1;

{$APPTYPE CONSOLE}

uses
  SynCommons,
  SysUtils;

var
  LTest : Variant;

begin
  LTest := _ObjFast( [] );
  LTest.prop := 'VALUE';
  DocVariantData( LTest ).AddValue( 'prop2', 'VALUE2' );
  Writeln( LTest );
  Readln;
end.

Previously (I have confirmed by going back to an older version) the following was output:

{"prop":"VALUE","prop2":"VALUE2"}

Using the latest version I get the following:

{"PROP":"VALUE","prop2":"VALUE2"}

Unfortunately the service processing this JSON in case sensitive so I can't send the uppercased version through.

Thanks,
Bernd

Offline

#2 2015-01-18 13:09:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: DocVariantData - item name uppercase.

Indeed.

I've re-activated our SynCommons.pas fix for Delphi 6 variants.pas unit to circumvent the bug, which is in variants.pas.
In Delphi 6 official Variants.pas unit, you have the following:

LIdent := Uppercase()

in TInvokeableVariantType.DispInvoke(), which breaks our expectations.

See http://synopse.info/fossil/info/883997ddc0

Offline

#3 2015-01-19 20:31:54

berndvf
Member
Registered: 2013-03-08
Posts: 16

Re: DocVariantData - item name uppercase.

Thank you so much! Updating to latest:)

Offline

Board footer

Powered by FluxBB