Here you can find the source of getUTF8(String s)
public static String getUTF8(String s)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static String getUTF8(String s) { if (s == null || s.equals("")) { return ""; }/*from w ww. ja va 2s. co m*/ String ss = ""; try { ss = new String(s.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return ss; } }