Chinese Characters in Oracle Service Bus
Hi All,
I am facing an issue when trying to convert XML to JSON in OSB with the names which are stored in Chinese in Oracle DB.
In XML Payload, it is coming as <name>北京文鼎拓达商贸有限公司</name>
When tried to convert from XML to JSON using NXSD translate, it was giving as binary-content which is further converted using below class-
Upon conversion, it is giving the JSON element as - "name" : "????????????"
Below is the class used to convert binary content-
package convertbinarytostring; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.io.ByteArrayInputStream; import java.util.Arrays; import java.util.Date; public class ConvertBinaryToString { public static String decodeBinaryToText(byte[] encodedDataRef) { String decodedData = ""; try { decodedData = new String(encodedDataRef); } catch (Exception e) { e.printStackTrace(); System.out.println("Error in conversion class"); } return decodedData; } }