Break string to Bytes using current string encoding format and then arrange those bytes in required encoding format.
e..g. Here, statusLine, errorCode and errorMsg are the string in ISO format & o/p will be in UTF-8 format.
String encodedStatusLine = new String(statusLine.getBytes( iso-8859-1 ), utf-8);
String encodedErrorCode = new String(errorCode.getBytes( iso-8859-1 ), utf-8);
String encodedErrorMsg = new String(errorMsg.getBytes( iso-8859-1 ), utf-8);
e..g. Here, statusLine, errorCode and errorMsg are the string in ISO format & o/p will be in UTF-8 format.
String encodedStatusLine = new String(statusLine.getBytes( iso-8859-1 ), utf-8);
String encodedErrorCode = new String(errorCode.getBytes( iso-8859-1 ), utf-8);
String encodedErrorMsg = new String(errorMsg.getBytes( iso-8859-1 ), utf-8);