함수 rawurldecode()

함수 rawurldecode()

1 Java[ | ]

String str1 = "a+b";
System.out.println( URLDecoder.decode(str1.replace("~","%7E").replace("+","%2B"), "UTF-8") );
// a+b
String str2 = "foo%20bar%40baz";
System.out.println( URLDecoder.decode(str2.replace("~","%7E").replace("+","%2B"), "UTF-8") );
// foo bar@baz
String str3 = "This%20is%20a%20%2Burl%2B%21";
System.out.println( URLDecoder.decode(str3.replace("~","%7E").replace("+","%2B"), "UTF-8") );
// This is a +url+!
String str4 = "http://zetawiki.com/wiki/%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9_.table-bordered";
System.out.println( URLDecoder.decode(str4.replace("~","%7E").replace("+","%2B"), "UTF-8") );
// http://zetawiki.com/wiki/부트스트랩_.table-bordered

2 JavaScript[ | ]

console.log( decodeURIComponent('a+b') );
console.log( decodeURIComponent('foo%20bar%40baz') );
console.log( decodeURIComponent('This%20is%20a%20%2Burl%2B%21') );
console.log( decodeURIComponent('http://zetawiki.com/wiki/%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9_.table-bordered') );
// a+b
// foo bar@baz
// This is a +url+!
// http://zetawiki.com/wiki/부트스트랩_.table-bordered

3 PHP[ | ]

echo rawurldecode('a+b');
# a+b
echo rawurldecode('foo%20bar%40baz');
# foo bar@baz
echo rawurlencode('This%20is%20a%20%2Burl%2B%21');
# This is a +url+!
echo rawurldecode('http://zetawiki.com/wiki/%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9_.table-bordered');
# http://zetawiki.com/wiki/부트스트랩_.table-bordered

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}