--- pathauto.module.old	 Sun Jun 05 00:08:48 2005
+++ pathauto.module	Tue Sep 06 08:06:16 2005
@@ -136,6 +136,7 @@
 // Clean up a string value provided by a module, resulting in a
 // string containing only alphanumerics and separators
 function _pathauto_cleanstring($string, $separator) {
+    $string =   _pathauto_translit($string);
   // Drop apostrophes
   $output = str_replace("'", "", $string);
   // Convert accented characters to their ASCII counterparts...
@@ -232,6 +233,7 @@
   // and lower-case the result
   $alias = str_replace(array_keys($placeholders), $placeholders, $pattern);
   $alias = strtolower($alias);
+ 
   
   // Two or more slashes should be collapsed into one
   $alias = preg_replace("/\/+/", "/", $alias);
@@ -326,4 +328,25 @@
   } 
 } // end function _pathauto_update 
 
+//convert cyrillic characters to translit
+function _pathauto_translit($str) {
+     //   $str = strtolower($str); spoils the string if it contains cyrillic characters
+    if(function_exists('mb_strtolower'))    {
+        $str = mb_strtolower($str);
+    }
+    elseif(function_exists('iconv'))   {
+        $str = iconv('UTF-8', 'windows-1251', $str);
+        $str = strtolower($str);
+        $str = iconv('windows-1251', 'UTF-8', $str);
+    }
+
+    $replacement = Array (
+    'а'=>'a', 'б'=>'b', 'в'=>'v', 'г'=>'g', 'д'=>'d', 'е'=>'e', 'ё'=>'yo', 'ж'=>'zh', 'з'=>'z', 'и'=>'i', 'й'=>'j', 'к'=>'k', 'л'=>'l', 'м'=>'m', 'н'=>'n',  'о'=>'o', 'п'=>'p', 'р'=>'r', 'с'=>'s', 'т'=>'t', 'у'=>'u', 'ф'=>'f', 'х'=>'h', 'ц'=>'c', 'ч'=>'ch', 'ш'=>'sh', 'щ'=>'sh', 'ъ'=>'', 'ы'=>'i', 'ь'=>'', 'э'=>'e', 'ю'=>'yu', 'я'=>'ya' 
+        );
+    $search = array_keys($replacement);
+    
+    $str =  str_replace($search, $replacement, $str);
+    return $str;
+
+}
 ?>
