I have an app that converts an html to an excel spreadsheet using java. There are some characters that are not being rendered correctly in excel. More than likely an encoding problem. I need a way to convert those strings in java to unicode (UTF-16) so they would be rendered correctly by excel.
Share
It looks like
String.getBytes(Charset charset)is the method you are looking for. It allows you to convert a string into a byte array with the given encoding. (As opposed toString.getBytes()which uses the default encoding)Your code could be like this:
For details see the Javadocs