Here you can find the source of encode(String value)
Parameter | Description |
---|---|
value | the value to encode |
Parameter | Description |
---|---|
UnsupportedEncodingException | an exception |
public static String encode(String value) throws UnsupportedEncodingException
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { /**/* ww w.j av a2 s . c o m*/ * URL encodes a value using the UTF-8 charset * * @param value the value to encode * @return the encoded value * @throws UnsupportedEncodingException */ public static String encode(String value) throws UnsupportedEncodingException { return URLEncoder.encode(value, "UTF-8"); } }