a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 134|回复: 0

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

[复制链接]
发表于 2012-8-4 12:44:44 | 显示全部楼层 |阅读模式
Java认证之JAVA的J2SE处理编码解码写法# M) }# A3 G/ X4 S
Java代码
! b6 ?& ^9 ~4 ]9 c# i4 j1 I( Z! f# Bimport java.net.URLDecoder;" W* s- A! J4 N& [) {$ e
public class URL {
+ L2 l  P9 P/ U. V$ [, k/**/ l9 f2 V- E7 i. H
* 解码应用案例9 D. q3 O+ p, ~( O% s: I$ H
* @param args
* y- ~3 {9 B; H1 B* @throws Exception
) n) }( l# p- T( z*/
7 M* s1 J3 D" l: m+ wpublic static void main(String[] args) throws Exception{
6 N1 }/ x* @- Z! x% Z) ^8 IString str = “C%3A%5CDocuments+and+Settings%5CAdministrator%5C%E6%A1%8C%E9%9D%A2%5Cother.txt”;
3 p' r3 e' r$ M% u0 HString result = URLDecoder.decode(str, “UTF-8”);4 Z0 w4 C& K9 N7 J: D; @( O
System.out.println(result);2 V& i8 {) ]& g
}
0 {; o+ O# m, [9 L}
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-27 23:54 , Processed in 0.483831 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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