[limb-svn] r5838 - 3.x/trunk/limb/i18n
svn at limb-project.com
svn at limb-project.com
Tue May 8 18:57:46 MSD 2007
Author: pachanga
Date: 2007-05-08 18:57:46 +0400 (Tue, 08 May 2007)
New Revision: 5838
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5838
Modified:
3.x/trunk/limb/i18n/common.inc.php
Log:
-- fixing encoding to utf-8
Modified: 3.x/trunk/limb/i18n/common.inc.php
===================================================================
--- 3.x/trunk/limb/i18n/common.inc.php 2007-05-08 14:19:37 UTC (rev 5837)
+++ 3.x/trunk/limb/i18n/common.inc.php 2007-05-08 14:57:46 UTC (rev 5838)
@@ -23,31 +23,31 @@
}
-function lmb_translit_russian($input, $encoding = 'utf8')
-{
- if($encoding != 'utf8')
- $input = iconv($encoding, 'utf8', $input);
-
- $arrRus = array('à', 'á', 'â', 'ã', 'ä', 'å', '¸', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì',
- 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ü',
- 'û', 'ú', 'ý', 'þ', 'ÿ',
- 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', '¨', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì',
- 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ü',
- 'Û', 'Ú', 'Ý', 'Þ', 'ß');
- $arrEng = array('a', 'b', 'v', 'g', 'd', 'e', 'jo', 'zh', 'z', 'i', 'y', 'k', 'l', 'm',
- 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'kh', 'c', 'ch', 'sh', 'sch', '',
- 'y', '', 'e', 'yu', 'ya',
- 'A', 'B', 'V', 'G', 'D', 'E', 'JO', 'ZH', 'Z', 'I', 'Y', 'K', 'L', 'M',
- 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'KH', 'C', 'CH', 'SH', 'SCH', '',
- 'Y', '', 'E', 'YU', 'YA');
-
+function lmb_translit_russian($input, $encoding = 'utf-8')
+{
+ $encoding = strtolower($encoding);
+ if($encoding != 'utf-8')
+ $input = iconv($encoding, 'utf-8', $input);
+
+ $arrRus = array('а', 'б', 'в', 'г', 'д', 'е', 'Ñ', 'ж', 'з', 'и', 'й', 'к', 'л', 'м',
+ 'н', 'о', 'п', 'Ñ', 'Ñ', 'Ñ', 'Ñ', 'Ñ', 'Ñ
', 'Ñ', 'Ñ', 'Ñ', 'Ñ', 'Ñ',
+ 'Ñ', 'Ñ', 'Ñ', 'Ñ', 'Ñ',
+ 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð', 'Ð',
+ 'Ð', 'Ð', 'Ð', 'Ð ', 'С', 'Т', 'У', 'Ф', 'Ð¥', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь',
+ 'Ы', 'Ъ', 'Ð', 'Ю', 'Я');
+ $arrEng = array('a', 'b', 'v', 'g', 'd', 'e', 'jo', 'zh', 'z', 'i', 'y', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'kh', 'c', 'ch', 'sh', 'sch', '',
+ 'y', '', 'e', 'yu', 'ya',
+ 'A', 'B', 'V', 'G', 'D', 'E', 'JO', 'ZH', 'Z', 'I', 'Y', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'KH', 'C', 'CH', 'SH', 'SCH', '',
+ 'Y', '', 'E', 'YU', 'YA');
+
$result = str_replace($arrRus, $arrEng, $input);
-
- if($encoding != 'utf8')
- return iconv('utf8', $encoding, $result);
- else
- return $result;
+
+ if($encoding != 'utf-8')
+ return iconv('utf-8', $encoding, $result);
+ else
+ return $result;
}
-
?>
More information about the limb-svn
mailing list