cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid character

cburghardt
Champ in-the-making
Champ in-the-making
In an repositoryService.update() call I get the following error:

        org.xml.sax.SAXParseException: An invalid XML character
(Unicode: 0x1c) was found in the element content of the document.

I know that this character is indeed illegal in XML but the question is how to get around this. I can't simply replace the character on the client side because I have to store the content in the original format (an email). So in order to process this correctly I need to encode it in the client and decode it to the original format on the server side if I'm not mistaken. Any hints on how to do this?

Regards,

Carsten
2 REPLIES 2

cburghardt
Champ in-the-making
Champ in-the-making
I have some more information regarding this. The error occurs in RepositoryService.create(CMLCreate) and seems to be a problem with unicode characters. When I create content and set the name or any of the NamedValue properties to a string encoded with KOI8-R I get this exception. I consider this a bug in the Webservice as there is definitely no 0x1e (control character RS) in the data that I set. This is Alfresco 2.1.

cburghardt
Champ in-the-making
Champ in-the-making
Replying again to myself just in case somebody else stumbles over this. I've modified the Webservice client to pass the correct encoding (not UTF-8 but e.g. KOI8-R) to the Call object of Axis (CHARACTER_SET_ENCODING). That way I can transfer the correctly encoded characters to the server (I checked this with tcpmon). But then I get error messages about other illegal characters like 0x1 once the content is parsed on the server side  :evil:
Does anybody have a working example to store somewhat "exotic" characters (chinese, kyrilic, whatever) as property in Alfresco?