|
|
|
13-10-22
|
조회 877
|
|
|
|
13-10-22
|
조회 990
|
|
|
|
13-10-22
|
조회 986
|
|
|
|
13-10-22
|
조회 1,133
|
|
|
|
13-10-22
|
조회 1,044
|
|
|
|
13-10-22
|
조회 1,717
|
|
|
|
13-10-22
|
조회 1,085
|
|
|
|
13-10-22
|
조회 1,096
|
|
|
|
13-10-22
|
조회 1,717
|
|
|
|
13-10-22
|
조회 1,180
|
|
|
|
13-10-22
|
조회 2,534
|
|
|
|
13-10-22
|
조회 1,208
|
|
|
|
13-10-22
|
조회 1,080
|
|
|
|
13-10-22
|
조회 1,291
|
|
|
|
13-10-22
|
조회 1,138
|
|
|
|
13-10-22
|
조회 1,681
|
|
|
|
13-10-22
|
조회 1,173
|
|
|
|
13-10-22
|
조회 1,323
|
|
|
|
13-10-22
|
조회 1,058
|
|
|
|
13-10-22
|
조회 1,826
|
댓글 2개
$chr_str = "\\u".dechex(rand( 44032 , 55203 ))."\\u".dechex(rand( 44032 , 55203 ))."\\u".dechex(rand( 44032 , 55203 ));
$s = preg_replace("/[\s]/s", "\u0020", $chr_str);
$s = preg_replace("/((\\\u([0-9A-F]+))|(.*?))/ie", "conv(\"$1\")", $s);
$s = rawurldecode($s);
echo iconv('utf-16be', 'CP949', $s);
// 정규식으로 뜯어낸 문자열을 적절히 변환
function conv($hex)
{
// 빈 값이면 빈값 반환
if (strlen($hex)<1) return '';
// 유니코드 문자열이 아니라면 url decode 되도록 구성하여 반환
if (isUnicode($hex)==false) return '%00'.$hex;
$hex = getFormatted($hex);
$sResult = '';
for ($i=0; $i<strlen($hex); $i++) {
if ($i%2==0) $sResult .= '%';
$sResult .= $hex[$i];
}
return $sResult;
}
// 유니코드 문자열인지 체크
function isUnicode($hex)
{
return strpos($hex, '\u')===0;
}
// urldecode 할 수 있도록 포매팅
function getFormatted($hex)
{
$hex = str_replace('\u', '', $hex);
$max = 4;
$len = strlen($hex);
if ($len<$max) {
for ($i=$len; $i<$max; $i++) $hex = '0'.$hex;
}
return $hex;
}
?>
참고 - http://bloodguy.tistory.com/666