Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ResponseContent.LineSeparator Question
Sat, Sep 22 2012 10:47 AMPermanent Link

George Smith

I am coding Tim's example and am successful using #10 as the line separator. However, I am trying to use char(253) or chr(253) depending on the language as my line separator.

Have tried:

// serverRequest.ResponseContent.LineSeparator := #10;
  serverRequest.ResponseContent.LineSeparator := chr(253);
  serverRequest.ResponseContent.LineSeparator := #253;

I can not seem to get it to work.

This is the php code I use for #10 and it works fine:

echo "Id="           . $Id                                       .  "\n";
echo "Name="     . "ACME Manufacturing, Inc."   .  "\n";
echo "Contact="  . "Bob Smith"                          .  "\n";
echo "Address="  . "100 Main Street"                  .  "\n";
echo "City="     . "Bedford Falls"                         .  "\n";
echo "State="    . "NY"                                       .  "\n";
echo "Zip="      . "11178";

and here is the php code for the char(253):

$stringData = 'Id='          . $Id                                     . chr(253) .
                    'Name='    . "ACME Manufacturing, Inc." . chr(253) .
                    'Contact=' . "Bob Smith"                        . chr(253) .
                    'Address=' . "100 Main Street"               . chr(253) .
                    'City='       . "Bedford Falls"                   . chr(253) .
                    'State='     . "NY"                                  . chr(253) .
                    'Zip='         . "11178";

echo $stringData;

Data arrival.
Request.RequestHeaders.Text
Content-Type:multipart/form-data; boundary=AaB03x

Request.ResponseContent.Text
Id=99999�Name=ACME Manufacturing, Inc.�Contact=Bob Smith�Address=100 Main Street�City=Bedford Falls�State=NY�Zip=11178


Request.ResponseContent.Count
1

Request.ResponseContent.LineSeparator
ý

This delimited data does arrive and I can display it in a memo but
I can not get the content to look like this (with the #01 seperator)

Request.ResponseContent.Text
Id=10025
Name=ACME Manufacturing, Inc.
Contact=Bob Smith
Address=100 Main Street
City=Bedford Falls
State=NY
Zip=11178


Any suggestions would be appreciated.

Thanks
George
Mon, Sep 24 2012 12:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

George,

<< Request.ResponseContent.Text
Id=99999&#65533;Name=ACME Manufacturing, Inc.&#65533;Contact=Bob
Smith&#65533;Address=100 Main Street&#65533;City=Bedford
Falls&#65533;State=NY&#65533;Zip=11178 >>

Character #65533 is the Unicode "replacement character" that is used when an
invalid character is encountered.

Is your PHP script sending back a content encoding specifier ?  That may be
why the browser is confused.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Sep 25 2012 8:53 AMPermanent Link

George Smith

Tim,

You were correct. Added following line to top of php script and it work perfectly.

header ('Content-type: text/html; charset=iso-8859-1');

George
Image