Bug #15902 ยป iconv-php4-typo3-4rc2.diff
t3lib/class.t3lib_cs.php 27 Mar 2006 08:57:24 -0000 | ||
---|---|---|
else {
|
||
return mb_substr($string,$start,$len,$charset);
|
||
}
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv') {
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv' && function_exists('iconv_substr')) {
|
||
// cannot omit $len, when specifying charset
|
||
if ($len==null) {
|
||
$enc = iconv_get_encoding('internal_encoding'); // save internal encoding
|
||
... | ... | |
function strlen($charset,$string) {
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
|
||
return mb_strlen($string,$charset);
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv') {
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv' && function_exists('iconv_strlen')) {
|
||
return iconv_strlen($string,$charset);
|
||
} elseif ($charset == 'utf-8') {
|
||
return $this->utf8_strlen($string);
|
||
... | ... | |
function utf8_strpos($haystack,$needle,$offset=0) {
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
|
||
return mb_strpos($haystack,$needle,$offset,'utf-8');
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv') {
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv' && function_exists('iconv_strpos')) {
|
||
return iconv_strpos($haystack,$needle,$offset,'utf-8');
|
||
}
|
||
... | ... | |
function utf8_strrpos($haystack,$needle) {
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
|
||
return mb_strrpos($haystack,$needle,'utf-8');
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv') {
|
||
} elseif ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'iconv' && function_exists('iconv_strrpos')) {
|
||
return iconv_strrpos($haystack,$needle,'utf-8');
|
||
}
|
||