public static String convertCharset(String source,String srcCharsetName,String newCharsetName){
  if (srcCharsetName.equals(newCharsetName)) {
    return source;
  }
  try {
    return new String(source.getBytes(srcCharsetName),newCharsetName);
  }
 catch (  UnsupportedEncodingException unex) {
    throw new IllegalArgumentException(unex);
  }
}

public static String convertCharset ( String source , String srcCharsetName , String newCharsetName ) { if ( srcCharsetName . equals ( newCharsetName ) ) { return source ; } try { return new String ( source . getBytes ( srcCharsetName ) , newCharsetName ) ; } catch ( UnsupportedEncodingException unex ) { throw new IllegalArgumentException ( unex ) ; } }
converts string charset . if charset names are the same , the same string is returned .
