Here you can find the source of toUTF8(String value)
public static String toUTF8(String value) throws UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; public class Main { public static String toUTF8(String value) throws UnsupportedEncodingException { if (value == null) { return ""; }/*from ww w.j a v a2 s.c o m*/ byte[] b = value.getBytes("ISO-8859-1"); return new String(b, "utf-8"); } }