php [php] mssql ms-sql 한글 변환 끄적임.. 정리
페이지 정보

본문
// echo mb_detect_encoding($result_rows[$i][USER_NAME]);
// $string = iconv('ASCII', 'UTF-8//IGNORE', $string);
// iconv("EUC-KR", "UTF-8", $data[REQ_USER_SIL]);
// $str = iconv('UCS-2LE', 'UTF-8', $str);
/*
$str = iconv('UCS-2BE', 'UTF-8', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF-8', 'EUCKR', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF-8', 'EUC-KR', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF-8', 'UCS-2', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF8', 'EUCKR', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF8', 'EUC-KR', $result_rows[$i][USER_NAME]) . " | " .
iconv('UTF-16BE', 'UTF-8', $result_rows[$i][USER_NAME]) . " | " .
iconv('CP-1252', 'UTF-8', $result_rows[$i][USER_NAME]) . " |##| " . $result_rows[$i][USER_NAME];
//$str = $result_rows[$i][USER_NAME];
/*
$chars_array = array("UTF-16BE", "UTF-16LE", "ISO-10646-UCS-2", "CP949", "EUC-KR", "ASCII", "iso-8859-1", "UCS-2", "UCS-2LE", "UCS-4LE", "UCS-2BE");
for ($i=0,$cnt=sizeof($chars_array); $i<$cnt; $i++) {
// 정상적으로 변환되는 캐릭터 셋이 무엇인지 출력 해 봄
echo "<b>" . ("{$chars_array[$i]} : ") . mb_convert_encoding($TTT,"UTF-8", $chars_array[$i]) . " / " . "</b>";
echo("{$chars_array[$i]} : ") . mb_convert_encoding($TTT,"UTF-8", $chars_array[$i]) . " / {$TTT[0][2]} / {$TTT[0][3]} / {$TTT[0][4]}<br>";
}
*/
/*
//Binary to hexadecimal
$hex = bin2hex($result_rows[$i][USER_NAME]);
//And then from hex to string
$str = "";
for ($i=0;$i<strlen($hex) -1;$i+=2)
{
$str .= chr(hexdec($hex[$i].$hex[$i+1]));
}
//And then from UCS-2LE/SQL_Latin1_General_CP1_CI_AS (that's the column format in the DB) to UTF-8
*/
댓글목록
등록된 댓글이 없습니다.