Discussion:
[phpxmlrpc] Newline issue
Crisses
2014-02-06 23:39:30 UTC
Permalink
Hi,

I'm new here -- thanks for a great package.

I'm working on MetaWeblog support for PmWiki -- we had Blogger support with XMLRPC years ago, the package maintainer disappeared and I'm trying to bring it up-to-date.

I've got some of it working, but the contents of the page are coming through with newlines \n recoded to 


I tried specifying "string", but that didn't help.

Is there a php encoding I should run on the string first, or class method I should be using? In the code below, it's "description" that has the problem. The text being sent should be RichText or plain text on the other end: newlines need to be preserved. I'm testing out my XMLRPC on the Ecto console.

Thank you!!!



return new xmlrpcval(
array(
"postid" => new xmlrpcval($page['name']),
"title" => new xmlrpcval($title),
"userid" => new xmlrpcval($page['author']),
"dateCreated" => new xmlrpcval($lastmodified, "dateTime.iso8601"),
"description" => new xmlrpcval("$EditText", "string"),
"link" => new xmlrpcval($link),
),"struct");

Crisses
Crisses
2014-02-07 02:13:27 UTC
Permalink
Thanks for a quick answer. I figured that was the ASCII for LF/newline. Unfortunately Ecto is displaying them as "#10" instead of displaying a newline. I thought I was doing something wrong, or at least others would have a similar issue and know how to fix it.

Do you know where the newlines are being encoded? I dumped the $EditText string to my log right before sending it to xmlrpcval and it has \n, not ascii encoding. i.e.:

"Some sample products:\n\n(:div class="flex-container":)\n(:div1 class="flexslider":)\n* %list slides% Attach:birdlove-med.jpg\n* Attach:bugpaw-med.jpg\n* Attach:cheetahs-med.jpg\n* Attach:chewtoy-med.jpg\n* Attach:Chicken-med.jpg\n(:div1end:)\n(:div:)\n\n[[!My Products]]\n(:title Products:)"\n

becomes:
<value><string>Some sample products:&#10;&#10;(:div class=&quot;flex-container&quot;:)&#10;(:div1 class=&quot;flexslider&quot;:)&#10;* %list slides% Attach:birdlove-med.jpg&#10;* Attach:bugpaw-med.jpg&#10;* Attach:cheetahs-med.jpg&#10;* Attach:chewtoy-med.jpg&#10;* Attach:Chicken-med.jpg&#10;(:div1end:)&#10;(:div:)&#10;&#10;[[!My Products]]&#10;(:title Products:)</string></value>

And finally, in Ecto:

Some sample products:#10#10(:div class="flex-container":)#10(:div1 class="flexslider":)#10* %list slides% Attach:birdlove-med.jpg#10* Attach:bugpaw-med.jpg#10* Attach:cheetahs-med.jpg#10* Attach:chewtoy-med.jpg#10* Attach:Chicken-med.jpg#10(:div1end:)#10(:div:)#10#10[[!My Products]]#10(:title Products:)

Where is the ascii translation taking place? Is there a way to stop it from encoding the newlines?

Thanks again!

Crisses
Post by Crisses
newlines \n recoded to &#10;
10 is the ASCII code for LF (e.g. newline) - I'm not sure if you are trying
to avoid \n(s) or expect them to be a different value.
-----Original Message-----
From: phpxmlrpc-bounces at lists.usefulinc.com
[mailto:phpxmlrpc-bounces at lists.usefulinc.com] On Behalf Of Crisses
Sent: Thursday, February 06, 2014 3:40 PM
To: phpxmlrpc at lists.usefulinc.com
Subject: [phpxmlrpc] Newline issue
Hi,
I'm new here -- thanks for a great package.
I'm working on MetaWeblog support for PmWiki -- we had Blogger support with
XMLRPC years ago, the package maintainer disappeared and I'm trying to bring
it up-to-date.
I've got some of it working, but the contents of the page are coming through
with newlines \n recoded to &#10;
I tried specifying "string", but that didn't help.
Is there a php encoding I should run on the string first, or class method I
should be using? In the code below, it's "description" that has the
problem. The text being sent should be RichText or plain text on the other
end: newlines need to be preserved. I'm testing out my XMLRPC on the Ecto
console.
Thank you!!!
return new xmlrpcval(
array(
"postid" => new xmlrpcval($page['name']),
"title" => new xmlrpcval($title),
"userid" => new xmlrpcval($page['author']),
"dateCreated" => new xmlrpcval($lastmodified, "dateTime.iso8601"),
"description" => new xmlrpcval("$EditText", "string"),
"link" => new xmlrpcval($link),
),"struct");
Crisses
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc at lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20140206/425aa224/attachment.html>
Loading...