<?

/* (C) 2006 honza klokanek sipek, klokanek (zavinac) eldar (tecka) cz */

// transcodes russian characters (written in windows-1251 encoding) stored
// in windows-1250 document to html entity
   
 /*
thanks to 
http://www.xs4all.nl/~wjsn/htmlcodes.htm and
http://www.xs4all.nl/~wjsn/russian.htm
*/



function russian2entity($input)
{
// small characters
$trans[]="&#1072;";
$trans[]="&#1073;";
$trans[]="&#1074;";
$trans[]="&#1075;";
$trans[]="&#1076;";
$trans[]="&#1077;";
$trans[]="&#1105;";
$trans[]="&#1078;";
$trans[]="&#1079;";
$trans[]="&#1080;";
$trans[]="&#1081;";
$trans[]="&#1082;";
$trans[]="&#1083;";
$trans[]="&#1084;";
$trans[]="&#1085;";
$trans[]="&#1086;";
$trans[]="&#1087;";
$trans[]="&#1088;";
$trans[]="&#1089;";
$trans[]="&#1090;";
$trans[]="&#1091;";
$trans[]="&#1092;";
$trans[]="&#1093;";
$trans[]="&#1094;";
$trans[]="&#1095;";
$trans[]="&#1096;";
$trans[]="&#1097;";
$trans[]="&#1098;";
$trans[]="&#1099;";
$trans[]="&#1100;";
$trans[]="&#1101;";
$trans[]="&#1102;";
$trans[]="&#1103;";

// big characters
$trans[A]="&#1040;";
$trans[]="&#1041;";
$trans[]="&#1042;";
$trans[A]="&#1043;";
$trans[]="&#1044;";
$trans[]="&#1045;";
$trans[]="&#1046;";
$trans[]="&#1047;";
$trans[]="&#1048;";
$trans[]="&#1049;";
$trans[]="&#1050;";
$trans[]="&#1051;";
$trans[]="&#1052;";
$trans[]="&#1053;";
$trans[]="&#1054;";
$trans[]="&#1055;";
$trans[]="&#1056;";
$trans[]="&#1057;";
$trans[]="&#1058;";
$trans[]="&#1059;";
$trans[]="&#1060;";
$trans[O]="&#1061;";
$trans[]="&#1062;";
$trans[]="&#1063;";
$trans[]="&#1064;";
$trans[]="&#1065;";
$trans[]="&#1066;";
$trans[]="&#1067;";
$trans[]="&#1068;";
$trans[]="&#1069;";
$trans[]="&#1070;";
$trans[]="&#1071;";



     
$output = (strtr($input$trans));
     return 
$output;

}

$text " ";
echo (
$text."<BR>");
echo(
russian2entity($text));
     
     
?>