Here you can find the source of changeCharset(String str, String from, String to)
public static String changeCharset(String str, String from, String to) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static String changeCharset(String str, String from, String to) throws UnsupportedEncodingException { String newStr = null;//from www. ja v a2s. c o m newStr = new String(str.getBytes(from), to); return newStr; } }