byte[] data;
ResultSet resultSet
data = resultSet.getBytes("xml");//It is XML of ANSI type from database(ms-sql);
I am trying to convert XML to UTF-8 type.
Please help me figure this out.
byte[] data;
ResultSet resultSet
data = resultSet.getBytes("xml");//It is XML of ANSI type from database(ms-sql);
I am trying to convert XML to UTF-8 type.
Please help me figure this out.
You might use the constructor of String that takes an encoding; for example, new String(data, "UTF-8");
It's probably easiest to just call resultSet.getString("xml");
You probably should just feed the bytes directly to an XML parser. XML almost requires the encoding to be specified, and the parser will figure it out on its own.