My application users need to upload a text file containing unicode(UTF-8) characters, but at the server side when converting the File contents the unicode characters are getting lost.
For example: BleȬÁno is converted into Ble?Áno.
public String getUploadFileAsString() {
try {
final InputStream stream = file.getInputStream();
final StringWriter writer = new StringWriter();
IOUtils.copy(stream, writer, Charsets.UTF_8);
return writer.toString();
} catch (final IOException e) {
throw new Exception("exception in getUploadFileAsString()", e);
}
}