Here you can find the source of getCharSetStr(String str, String oldCharSet, String newCharSet)
public static String getCharSetStr(String str, String oldCharSet, String newCharSet)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static String getCharSetStr(String str, String oldCharSet, String newCharSet) { if (str == "" || str == null) { return ""; }//from w w w. j a v a 2s . c om try { str = new String(str.getBytes(oldCharSet), newCharSet); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return str; } }