|
From: FlorinCB <ory...@us...> - 2008-10-06 00:45:43
|
Update of /cvsroot/mxbb/core/includes/utf In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4169 Modified Files: utf_normalizer.php utf_tools.php Log Message: Added utf tools borowed from phpBB3 Index: utf_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/utf/utf_tools.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** utf_tools.php 6 Oct 2008 00:35:54 -0000 1.2 --- utf_tools.php 6 Oct 2008 00:45:38 -0000 1.3 *************** *** 779,783 **** } ! global $phpbb_root_path, $phpEx; // iso-8859-* character encoding --- 779,783 ---- } ! global $mx_root_path, $phpEx; // iso-8859-* character encoding *************** *** 795,803 **** if (!function_exists('iso_8859_' . $array[1])) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return call_user_func('iso_8859_' . $array[1], $string); --- 795,803 ---- if (!function_exists('iso_8859_' . $array[1])) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return call_user_func('iso_8859_' . $array[1], $string); *************** *** 827,835 **** if (!function_exists('cp' . $array[1])) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return call_user_func('cp' . $array[1], $string); --- 827,835 ---- if (!function_exists('cp' . $array[1])) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return call_user_func('cp' . $array[1], $string); *************** *** 847,855 **** if (!function_exists('tis_620')) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return tis_620($string); --- 847,855 ---- if (!function_exists('tis_620')) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { trigger_error('Basic reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } return tis_620($string); *************** *** 861,869 **** if (!function_exists('sjis')) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return sjis($string); --- 861,869 ---- if (!function_exists('sjis')) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return sjis($string); *************** *** 875,883 **** if (!function_exists('euc_kr')) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return euc_kr($string); --- 875,883 ---- if (!function_exists('euc_kr')) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return euc_kr($string); *************** *** 889,897 **** if (!function_exists('big5')) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return big5($string); --- 889,897 ---- if (!function_exists('big5')) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return big5($string); *************** *** 903,911 **** if (!function_exists('gb2312')) { ! if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($phpbb_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return gb2312($string); --- 903,911 ---- if (!function_exists('gb2312')) { ! if (!file_exists($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx)) { trigger_error('CJK reencoder file is missing', E_USER_ERROR); } ! include($mx_root_path . 'includes/utf/data/recode_cjk.' . $phpEx); } return gb2312($string); *************** *** 1039,1048 **** { static $uniarray = array(); ! global $phpbb_root_path, $phpEx; // common is always set if (!isset($uniarray['c'])) { ! $uniarray['c'] = include($phpbb_root_path . 'includes/utf/data/case_fold_c.' . $phpEx); } --- 1039,1048 ---- { static $uniarray = array(); ! global $mx_root_path, $phpEx; // common is always set if (!isset($uniarray['c'])) { ! $uniarray['c'] = include($mx_root_path . 'includes/utf/data/case_fold_c.' . $phpEx); } *************** *** 1050,1054 **** if ($option === 'full' && !isset($uniarray['f'])) { ! $uniarray['f'] = include($phpbb_root_path . 'includes/utf/data/case_fold_f.' . $phpEx); } --- 1050,1054 ---- if ($option === 'full' && !isset($uniarray['f'])) { ! $uniarray['f'] = include($mx_root_path . 'includes/utf/data/case_fold_f.' . $phpEx); } *************** *** 1056,1060 **** if ($option !== 'full' && !isset($uniarray['s'])) { ! $uniarray['s'] = include($phpbb_root_path . 'includes/utf/data/case_fold_s.' . $phpEx); } --- 1056,1060 ---- if ($option !== 'full' && !isset($uniarray['s'])) { ! $uniarray['s'] = include($mx_root_path . 'includes/utf/data/case_fold_s.' . $phpEx); } *************** *** 1653,1657 **** "\xF0\x9D\x9F\x8A" => "\xCF\x9D", ); ! global $phpbb_root_path, $phpEx; // do the case fold --- 1653,1657 ---- "\xF0\x9D\x9F\x8A" => "\xCF\x9D", ); ! global $mx_root_path, $phpEx; // do the case fold *************** *** 1660,1665 **** if (!class_exists('utf_normalizer')) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } --- 1660,1665 ---- if (!class_exists('utf_normalizer')) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } *************** *** 1750,1754 **** "\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85", ); ! global $phpbb_root_path, $phpEx; // perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition --- 1750,1754 ---- "\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85", ); ! global $mx_root_path, $phpEx; // perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition *************** *** 1777,1782 **** if (!class_exists('utf_normalizer')) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } --- 1777,1782 ---- if (!class_exists('utf_normalizer')) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } *************** *** 1821,1830 **** function utf8_clean_string($text) { ! global $phpbb_root_path, $phpEx; static $homographs = array(); if (empty($homographs)) { ! $homographs = include($phpbb_root_path . 'includes/utf/data/confusables.' . $phpEx); } --- 1821,1830 ---- function utf8_clean_string($text) { ! global $mx_root_path, $phpEx; static $homographs = array(); if (empty($homographs)) { ! $homographs = include($mx_root_path . 'includes/utf/data/confusables.' . $phpEx); } Index: utf_normalizer.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/utf/utf_normalizer.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** utf_normalizer.php 6 Oct 2008 00:35:54 -0000 1.2 --- utf_normalizer.php 6 Oct 2008 00:45:38 -0000 1.3 *************** *** 97,108 **** if (!isset($GLOBALS['utf_nfc_qc'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } --- 97,108 ---- if (!isset($GLOBALS['utf_nfc_qc'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } *************** *** 137,148 **** if (!isset($GLOBALS['utf_nfc_qc'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } --- 137,148 ---- if (!isset($GLOBALS['utf_nfc_qc'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } *************** *** 170,181 **** if (!isset($GLOBALS['utf_nfkc_qc'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_compatibility_decomp'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx); } --- 170,181 ---- if (!isset($GLOBALS['utf_nfkc_qc'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx); } if (!isset($GLOBALS['utf_compatibility_decomp'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx); } *************** *** 206,211 **** if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } --- 206,211 ---- if (!isset($GLOBALS['utf_canonical_decomp'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx); } *************** *** 234,239 **** if (!isset($GLOBALS['utf_compatibility_decomp'])) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx); } --- 234,239 ---- if (!isset($GLOBALS['utf_compatibility_decomp'])) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx); } *************** *** 265,270 **** if (!isset($utf_jamo_index, $utf_jamo_type, $utf_combining_class)) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx); } --- 265,270 ---- if (!isset($utf_jamo_index, $utf_jamo_type, $utf_combining_class)) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx); } *************** *** 272,277 **** if (!isset($utf_canonical_comp)) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx); } --- 272,277 ---- if (!isset($utf_canonical_comp)) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx); } *************** *** 967,972 **** if (!isset($utf_combining_class)) { ! global $phpbb_root_path, $phpEx; ! include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx); } --- 967,972 ---- if (!isset($utf_combining_class)) { ! global $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx); } |