Re: Newline issue

Crisses <[email protected]> Thu, 6 Feb 2014 21:13:27 -0500
Newsgroups gmane.comp.php.xml-rpc
Message-ID <[email protected]>
--===============1003713821153457601==
Content-Type: multipart/alternative; boundary=Apple-Mail-257--1032336491


--Apple-Mail-257--1032336491
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

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=3D"flex-container":)\n(:div1 =
class=3D"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=3D&quot;flex-container&quot;:)&#10;(:div1 =
class=3D&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=3D"flex-container":)#10(:div1 =
class=3D"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

On Feb 6, 2014, at 7:31 PM, Ken Almond wrote:

>> 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.=20
>=20
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Crisses
> Sent: Thursday, February 06, 2014 3:40 PM
> To: [email protected]
> Subject: [phpxmlrpc] Newline issue
>=20
> Hi,
>=20
> I'm new here -- thanks for a great package.
>=20
> 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.
>=20
> I've got some of it working, but the contents of the page are coming =
through
> with newlines \n recoded to &#10;
>=20
> I tried specifying "string", but that didn't help.
>=20
> 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.
>=20
> Thank you!!!
>=20
>=20
>=20
>    return new xmlrpcval(
>                    array(
>                          "postid" =3D> new xmlrpcval($page['name']),
>                          "title" =3D> new xmlrpcval($title),
>                          "userid" =3D> new xmlrpcval($page['author']),
>                          "dateCreated" =3D> new =
xmlrpcval($lastmodified,
> "dateTime.iso8601"),
>                          "description" =3D> new xmlrpcval("$EditText",
> "string"),
>                          "link" =3D> new xmlrpcval($link),
>                          ),"struct");
>=20
> Crisses
>=20
> _______________________________________________
> phpxmlrpc mailing list
> [email protected]
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
>=20


--Apple-Mail-257--1032336491
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><div>Thanks for a quick answer. &nbsp;I figured that was the ASCII for =
LF/newline. &nbsp;Unfortunately Ecto is displaying them as "#10" instead =
of displaying a newline. &nbsp;I thought I was doing something wrong, or =
at least others would have a similar issue and know how to fix =
it.</div><div><br></div><div>Do you know where the newlines are being =
encoded? &nbsp;I dumped the $EditText string to my log right before =
sending it to xmlrpcval and it has \n, not ascii encoding. =
&nbsp;i.e.:</div><div><br></div><div>"Some sample products:\n\n(:div =
class=3D"flex-container":)\n(:div1 class=3D"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</div><div><br></div><div>becomes:</div><div>&lt;value&gt;&lt=
;string&gt;Some sample products:&amp;#10;&amp;#10;(:div =
class=3D&amp;quot;flex-container&amp;quot;:)&amp;#10;(:div1 =
class=3D&amp;quot;flexslider&amp;quot;:)&amp;#10;* %list slides% =
Attach:birdlove-med.jpg&amp;#10;* Attach:bugpaw-med.jpg&amp;#10;* =
Attach:cheetahs-med.jpg&amp;#10;* Attach:chewtoy-med.jpg&amp;#10;* =
Attach:Chicken-med.jpg&amp;#10;(:div1end:)&amp;#10;(:div:)&amp;#10;&amp;#1=
0;[[!My Products]]&amp;#10;(:title =
Products:)&lt;/string&gt;&lt;/value&gt;</div><div><br></div><div>And =
finally, in Ecto:</div><div><br></div><div>Some sample =
products:#10#10(:div class=3D"flex-container":)#10(:div1 =
class=3D"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:)</div><div><br></div><div>Where is the =
ascii translation taking place? &nbsp;Is there a way to stop it from =
encoding the newlines?</div><div><br></div><div>Thanks =
again!</div><div><br></div><div><div><div>
<p style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><font face=3D"Comic Sans =
MS" size=3D"3" style=3D"font: 12.0px Comic Sans MS">Crisses</font></p>
<p style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><br></p></div><div><div>On =
Feb 6, 2014, at 7:31 PM, Ken Almond wrote:</div><br =
class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><div><blockquote type=3D"cite">newlines \n recoded to =
&amp;#10;<br></blockquote>10 is the ASCII code for LF (e.g. newline) - =
I'm not sure if you are trying<br>to avoid \n(s) or expect them to be a =
different value. <br><br>-----Original Message-----<br>From: <a =
href=3D"mailto:[email protected]">phpxmlrpc-bounces@li=
sts.usefulinc.com</a><br>[mailto:[email protected]] =
On Behalf Of Crisses<br>Sent: Thursday, February 06, 2014 3:40 PM<br>To: =
<a =
href=3D"mailto:[email protected]">[email protected]=
m</a><br>Subject: [phpxmlrpc] Newline issue<br><br>Hi,<br><br>I'm new =
here -- thanks for a great package.<br><br>I'm working on MetaWeblog =
support for PmWiki -- we had Blogger support with<br>XMLRPC years ago, =
the package maintainer disappeared and I'm trying to bring<br>it =
up-to-date.<br><br>I've got some of it working, but the contents of the =
page are coming through<br>with newlines \n recoded to =
&amp;#10;<br><br>I tried specifying "string", but that didn't =
help.<br><br>Is there a php encoding I should run on the string first, =
or class method I<br>should be using? &nbsp;In the code below, it's =
"description" that has the<br>problem. &nbsp;The text being sent should =
be RichText or plain text on the other<br>end: newlines need to be =
preserved. &nbsp;I'm testing out my XMLRPC on the =
Ecto<br>console.<br><br>Thank you!!!<br><br><br><br> =
&nbsp;&nbsp;&nbsp;return new xmlrpcval(<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"postid" =3D&gt; new xmlrpcval($page['name']),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"title" =3D&gt; new xmlrpcval($title),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"userid" =3D&gt; new xmlrpcval($page['author']),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"dateCreated" =3D&gt; new =
xmlrpcval($lastmodified,<br>"dateTime.iso8601"),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"description" =3D&gt; new xmlrpcval("$EditText",<br>"string"),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;"link" =3D&gt; new xmlrpcval($link),<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;),"struct");<br><br>Crisses<br><br>_____________________________________=
__________<br>phpxmlrpc mailing list<br><a =
href=3D"mailto:[email protected]">[email protected]=
m</a><br><a =
href=3D"http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc">htt=
p://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc</a><br><br></di=
v></blockquote></div><br></div></div></body></html>=

--Apple-Mail-257--1032336491--

--===============1003713821153457601==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
phpxmlrpc mailing list
[email protected]
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc

--===============1003713821153457601==--