Charset Auto Detection(캐릭터셋 자동 감지) 정보
기타 Charset Auto Detection(캐릭터셋 자동 감지)관련링크
http://my.oops.org/126
127회 연결
본문
명시적으로 캐릭터셋을 정하지 않는 상태에서
param 으로 넘어온값이나, 문자열의 charset을 검출해야 하는 경우가 있습니다.
흔하게 발생되는 경우는 아니지만, 외부 시스템 연동과 같은 특수상황에서는 종종 발생하는 케이스입니다.
자바쪽 자료를 찾다가 php 자료들도 보이길래 정리해봅니다.
자동검출이기 때문에 100% 완벽하지 않습니다.
1. mb_detect_encoding()
- http://kr.php.net/manual/en/function.mb-detect-encoding.php
2. 캐릭터셋의 바이트 구조를 분석하여 직접 코딩
- http://my.oops.org/62
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | http://my.oops.org/126<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
param 으로 넘어온값이나, 문자열의 charset을 검출해야 하는 경우가 있습니다.
흔하게 발생되는 경우는 아니지만, 외부 시스템 연동과 같은 특수상황에서는 종종 발생하는 케이스입니다.
자바쪽 자료를 찾다가 php 자료들도 보이길래 정리해봅니다.
자동검출이기 때문에 100% 완벽하지 않습니다.
1. mb_detect_encoding()
- http://kr.php.net/manual/en/function.mb-detect-encoding.php
2. 캐릭터셋의 바이트 구조를 분석하여 직접 코딩
- http://my.oops.org/62
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | http://my.oops.org/126<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
추천
0
0
댓글 1개
내가 조아라 하는 pear소스네요...ㅎㅎ