AFAIK there should be no problems with \n cahracters.

The xml spec (section 2.1.1) dictates that newlines inside xml element text be 
normalized to \n, and this is what happens dutifully with the php xmlrpc lib:

if the server sends this string:
" a\n b\r\n c\r d\n\r e"

the client will receive
" a\n b\n c\n d\n\n e"

I just tried this on my box and it works (I use a patched version of the lib, 
but it has nothing to do with string encoding)

1) Is the client you are talking about a phpxmlrpc client?

2) Is it on a windows box? If so take care: if e.g. the client saves the string 
to a text file and then you open it with notepad, the \n line endings instead 
of \r\n will be misunderstood.


> -----Messaggio originale-----
> [mailto:[EMAIL PROTECTED] conto di 
> keroppi kero
> Inviato: mercoledì 24 novembre 2004 20:19
> Oggetto: [phpxmlrpc] phpxmlrpc with \n caracters
> I'm using phpxmlrpc.
> I have a phpxmlrpc server wich returns a string.
> I have a client wich call this server and caught a string.
> The server return a string with \n caracters but when the 
> client reads this 
> string it can't find \n caracters.
> How can I don't lose this caracters?
> The server creates itself by this form: $s=new 
> xmlrpc_server(array("texto.corrige" =>array("function" => 
> "corrige")));
> And the corrige function has this return line:
> return new xmlrpcresp(new xmlrpcval($aspellret));
> where $aspellret is a string that has \n caracters.
> keroppi
> _________________________________________________________________
> Acepta el reto MSN Premium: Correos más divertidos con fotos y textos 
> increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. 
> _correosmasdivertidos
> _______________________________________________
> phpxmlrpc mailing list

phpxmlrpc mailing list

Reply via email to