Source for file Common.php
Documentation is available at Common.php
* For PHP internal iconv/mbstring support on KSC5601 package
* Check iconv or mbstring support, and auto select iconv or mbstring api.
* If support both iconv and mbstring extensions, first iconv.
* @subpackage KSC5601_Common
* @author JoungKyun.Kim <http://oops.org>
* @copyright (c) 2015, JoungKyun.Kim
* @link http://pear.oops.org/package/KSC5601
* For PHP internal iconv/mbstring support
* This class support check of using iconv/mbstring method and iconv/mbstring
// {{{ public (bool) is_iconv ()
* Check to enable iconv extension on this session.
// {{{ public (bool) is_mbstring ()
* Check to enable mbstring extension on this session.
// {{{ public (bool) is_extfunc ()
* Check to enable iconv or mbstring extension on this session.
* @return boolean If support to iconv or mbstring, return true
// {{{ public (string|false) extfunc ($from, $to, $str)
* iconv/mbstring wrapper function
* If enable iconv, use iconv. If disable iconv and enable mbstring,
* use mbstring. If disable both iconv and mbstring, return false
* @return false|stringReturn false when don't support both iconv and mbstring
* @param string $from From charset
* @param string $to To charset
* @param string $str Given strings.
function extfunc ($from, $to, $str) {
if ( self::is_iconv () === true )
return iconv ($from, $to, $str);
if ( self::is_mbstring () === true )
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
|