Here you can find the source of encodeStr(String str)
public static String encodeStr(String str)
//package com.java2s; //License from project: LGPL import java.io.UnsupportedEncodingException; public class Main { public static String encodeStr(String str) { try {/*from w ww.j ava 2 s . c om*/ return new String(str.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; } } }