Here you can find the source of utf8Encode(String url)
public static String utf8Encode(String url)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; public class Main { public static String utf8Encode(String url) { return urlEncode(url, StandardCharsets.UTF_8); }/*from w ww . j a v a2s . c om*/ public static String urlEncode(String url, Charset cs) { try { return URLEncoder.encode(url, cs.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } }