Here you can find the source of encodeString(String text, String charsetName)
public static String encodeString(String text, String charsetName)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static String encodeString(String text, String charsetName) { if (text != null) { byte bbb[] = text.getBytes(); try { return new String(bbb, charsetName); } catch (UnsupportedEncodingException e) { e.printStackTrace();// w w w. j a v a 2 s . com } return text; } return text; } }