First and foremost I would recommend avoiding encoding a PaperForms barcode with XML, unless it is absolutely required.
I would not have expected this result with invalid XML but rather a run-time error.
Is this ES 8.x or ES2 (9.0)? I tested decoding invalid XML in ES2 and my process results in a run-time error.
My case is also about special characters. I am using delimited PaperForms barcode. Occasionally, the user enters some unicode characters, and the decoding process returns something like '𠕇𠗟𣿅 '. Is there any way to enforce Barcoded Forms ES2 to return me unicode?
Yes. You can set the character encoding in the barcode in LiveCycle Designer ES2 to UTF-8, UTF-16, UCS-2, ISO-8859-1, etcetera. On the decode side, the Decode operation in the BarcodedFormService supports a similar list of encodings in the CharSet drop-down in the Input properties.
I have already encoded decode operation in UTF-8. In form level, because it is an acrobat form, no option to choose the encoding as in LC Designer. In further tests, if I change the extractToXML output to XDP instead of XFDF, then I will receive data rather than &# sequence. It is strange. Don't understand why XDP and XFDF would give out different encoding.