Re: Problem with UTF-8
"luisicozgz" <[email protected]> Thu, 13 Sep 2007 14:24:28 -0000
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have discovered that I have a problem with the accents.I received this response: <methodResponse> <params> <param> <value><array> <data> <value><struct> <member><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. --- In [email protected], John Wilson <tug@...> wrote: > > > On 10 Sep 2007, at 15:31, Stephane Bortzmeyer wrote: > > > On Mon, Sep 10, 2007 at 02:09:38PM -0000, > > luisicozgz <luisicozgz@...> wrote > > a message of 518 lines which said: > > > >> <member><name>direccion</name> > > > > Is it really direccion and not dirección? Because the result you > > posted has only ASCII characters so I really do not see how it could > > raise UTF-8 problems. > > > If it is dirección then what's probably happening is that the server > is encoding the response in ISO 8859/1 but we can see from the > message dump it is not emitting an XML declaration. > > This is a bug in your server implementation. > > > John Wilson > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/xml-rpc/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/xml-rpc/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/