a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 118|回复: 0

[专业语言] Java认证之JAVA的J2SE处理编码解码写法

[复制链接]
发表于 2012-8-4 12:44:44 | 显示全部楼层 |阅读模式
Java认证之JAVA的J2SE处理编码解码写法5 e  Q' G0 Y7 N5 M0 I
Java代码
9 D. ?8 ?3 k& @0 R9 e! ^1 Wimport java.net.URLDecoder;/ H) d+ L% a# \) |
public class URL {
( Q* J9 j  {0 T7 O) Y- M/**+ }1 {4 z! O9 B. X$ u( U
* 解码应用案例2 b1 ^- o/ o5 U3 R7 j, M& B
* @param args
8 Y6 h* S, V7 u' ]4 u6 N( e* @throws Exception
) {5 p+ r( \5 w) x! Z  `* d* m*/1 t; A* R/ A6 y8 J1 j
public static void main(String[] args) throws Exception{
7 U; c4 L1 y0 t# ~( FString str = “C%3A%5CDocuments+and+Settings%5CAdministrator%5C%E6%A1%8C%E9%9D%A2%5Cother.txt”;  u" M  u) I8 w& G% u5 a
String result = URLDecoder.decode(str, “UTF-8”);
7 ?" |7 z# P- N. lSystem.out.println(result);
4 Z  L& K+ x1 m}
' U3 L7 ^1 h5 c7 t}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-11 03:43 , Processed in 0.185254 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表