I am converting Strings that I retrieve from the MySql database, however in the database it is saved as UTF-8 to ISO and I am using the code below.
public static String ISO(String str) {
Charset utf8charset = Charset.forName("UTF-8");
Charset iso88591charset = Charset.forName("ISO-8859-1");
ByteBuffer inputBuffer = ByteBuffer.wrap(str.getBytes());
// decode UTF-8
CharBuffer data = utf8charset.decode(inputBuffer);
// encode ISO-8559-1
ByteBuffer outputBuffer = iso88591charset.encode(data);
byte[] outputData = outputBuffer.array();
return new String(outputData);
}
but the capital letter and acute accent as in the word Water is saved on the bank as follows "Water", and in the conversion it does not change, it brings "the water" to the other accents it converts normally.
What can it be?
Does anyone have any idea why only this character does not convert?