On 13 Sep 2007, at 15:26, luis ...... wrote:
Hello,
I have discovered that I have a problem with the accents and the
encoding.I received this response:
<methodResponse><params><param><value><array><data><value><struct><mem
ber><name>nombre</name><value><string>HOSTAL ANTÓN</string></
value></member><member><name>direccion</name><value><string>ANTÓN</
string></value></member><member><name>codigo_postal</
name><value><string>50619</string></value></
member><member><name>zona</name><value><int>1</int></value></
member><member><name>poblacion</name><value><int>1</int></value></
member></struct></value></data></array></value></param></params></
methodResponse>
The XML-RPC response is ISO-8859-1 enconding.In Java, when I
receive the response, the console is this:
[Fatal Error] :95:32: Invalid byte 2 of 2-byte UTF-8
sequence.org.apache.xmlrpc.client.XmlRpcClientException: Failed to
parse servers response: Invalid byte 2 of 2-byte UTF-8 sequence. at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse
(XmlRpcStreamTransport.java:177) at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest
(XmlRpcStreamTransport.java:145) at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest
(XmlRpcHttpTransport.java:94) at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest
(XmlRpcSunHttpTransport.java:44) at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute
(XmlRpcClientWorker.java:53) at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:
166) at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:136) at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:
125) at comunicacion.<init>(comunicacion.java:109) at Main.main
(Main.java:14)
Must I change in XML-RPC to UTF-8 encoding?Or must I change in Java
to ISO-8859-1?
Can somebody help me?
Thanks a lot.
You server is sending using 8859/1 encoding but is nor declaring the
encoding in an XML header. This is invalid XML.
You server should either use UTF-8 or emit a valid XML header. I'd
advise using UTF-8.
You can't fix this at the client end.
John Wilson
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]