Hi
        The tuscany sdo 's java implementation can load xml (contains
muti-byte code) correct. But cannot save the sdo (has Chinese character
value) to xml correctly;

        For example:
        I could load a xml(utf-8 encoding specified) which contains Chinese
character to sdo correctly. But it will failed to save it to xml (using
utf-8 encoding).

        I have ensured using correct "javac -encoding   " to compile the
source java file.

Code sample:

String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns:StringE
xmlns:ns=\"http://test/choice\";>中文</ns:StringE>";
XMLDocument doc= scope.getXMLHelper().load(s);
DataObject o = doc.getRootObject();

//here we'll load the xml success; and the assertion will passed
 assertTrue(((SimpleAnyTypeDataObjectImpl)o).getValue().toString().indexOf("
中文") >= 0);
            
String xml = scope.getXMLHelper().save(o,  uri, name);
//assertion failed, here we'll got a xml (using utf-8 encoding) contains
error character code.
assertTrue(xml.indexOf("中文") >= 0); 



Reply via email to