From: dr. J. A. <info@CompChemCons.com> - 2007-03-24 15:57:31
|
I found a solution, but I do not understand why it works. The first line of the file that is loaded contains: <?xml version="1.0" encoding="ISO-8859-1"> When I load the contents of the file into a Java String, and then submit that to the xml-rpc, the german characters get skrewed up. If I do however remove the <?xml ...> statement from the string, the german characters are OK when I look at the document in the database. Might it be that the xml-rpc does not like "<?xml version="1.0" encoding="ISO-8859-1">" as content ? With best regards Jozef Aerts ----- Original Message ----- From: "Wolfgang Meier" <wol...@gm...> To: "dr. Jozef Aerts" <in...@co...> Cc: <exi...@li...> Sent: Friday, March 23, 2007 12:21 PM Subject: Re: [Exist-open] Help: xmlrpc encoding problem when upoadingxmlfile with ISO-8859-1 encoding >> I tried your solution, but it doesn't work. The German characters are >> translated into question marks. > > Sometimes Java will replace characters by a question mark if it thinks > it cannot display them. To be sure, save the output to a file and open > it in a unicode capable editor (like vim). > >> I need to note that the file comes from an external source, and is >> already >> ISO-8859-1 encoded (so not done by Java). > > This should not be a problem. You just have to make sure you use the > correct input encoding when reading the file into a string: > > String resultXML = new String (b, "ISO-8859-1"); > >> Is it really so that the XmlRpc default encoding should always be UTF-8 >> for >> eXist to work properly ? >> Does it mean I cannot send ISO-8859-1 strings using XmlRpc ? > > No, you have to distinguish between the character encoding used by the > XmlRpc protocol itself and the encoding used for the data sent over > that protocol. The document data is sent as a binary block and should > not be changed during transport. It should thus not be a problem to > use ISO-8859-1 for the document data and UTF-8 for XmlRpc. > > Please note: eXist stores everything in UTF-8, so if you retrieve the > document after storing it in the db, it will be in UTF-8 unless you > select a different encoding. > >> How does the eXist Java client do that ? I was thinking it also uses >> XmlRpc. > > Yes, it uses the same methods. > > Wolfgang > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open |