[topic] URL特殊文字のエスケープ
Posted feedbacks - Java
Javaだとこんな感じ
1 2 3 4 5 6 7 8 9 | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class UrlEscape {
public static void main(String[] args)
throws UnsupportedEncodingException {
String encoded = URLEncoder.encode("~url quote/ほげ", "UTF-8");
System.out.println(encoded); // => %7Eurl+quote%2F%E3%81%BB%E3%81%92
}
}
|

にしお
#4156()
Rating0/0=0.00
URL用に特殊な文字をエスケープする。
[ reply ]