<html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-16"> </head><body bgcolor="yellow"><b><font color="darkblue"></font></b><center><b><font color="darkblue"> > #  M / =&gt; / B ( ?  K !  5   C $ ? & G 5 010 + < K # M  * 0 ? 5 0 M $ ? $ M 0 (26-02-2010)</font></b> <font color="blue">Last update: 26-02-2010 11:00</font><br> <script type="text/javascript"> function convert_to_Unicode_and_Krutidev010() { convert_Chanakya_to_Unicode() ; convert_Unicode_to_Krutidev010() ; function convert_Chanakya_to_Unicode() { var array_one = new Array( "","U", // correct anusvAr+ekAr, ekAr+nuqta to the reverse order "","","", "","","", // These two lines are identical except for position of nukta, ie before or after the consonant. //"" ", "", "", "", "", "", "", "", "", "", "" " , "" , "" , "" , "" , "" , "" , "" , "" , "" , "A","B","C","D","E","F","G","H","I","J","K","L","M", "N","O","P","Q","R","T","V","W","X","Y", "`","a","b","d","e","f","g","h","i","j","k","l","m","n","p","q","r","s","t","u", "~","~","#","%","@", " ","","","","","", "C","q","","u","g", "x","","","", "^","h","","","", "","","","","","","Z","","","","","","","","","", " ", "", "", "", " ", "", "", "", "", " "," ","",""," ","& "," ","","",""," "," ", "","","","","! ","! ", "","","0 ","","","","`","","","","9 ","","9 ", "R","","","","}","","","","","", "","","","","","","","","", "","","o","","","c","","S","","","", "","","","",""!",""!","", "","","","","","","","","","","","","","","", "","","","","","","","","", "0","1","2","3","4","5","6","7","8","9", "","v","w","x","y","z","{","|","}","~", "M K ","M L ","M > G ", "M > > ","> G ","> G ","> H ","M > "," A "," G ","K G ","> G ","   " ) var array_two = new Array( "", "", // correct anusvAr+ekAr, ekAr+nuqta to the reverse order "", "", "", "'", " ", "^ M ", //"X ","Y ","Z ","[ ","\ ","] ","^ ","_ ","1 ", "X " , "Y " , "Z " , "[ " , "\ " , "] " , "^ " , "_ " , "1 " , ") " , "M 0 "," M  ","7 M  ","7 M ","6 M 5 ","8 M ( ","$ M 0 ","e ","" M " "," M 5 ","M / ","0 A ","0 B ", "9 C ","9 M 0 "," M  "," M $ "," M 0 "," M  "," M  "," M  "," M  "," M  ", " M 5 ","! M ! ","! M " ","8 M 0 ","& M  ","& M  ","& M & ","& M ' ","& M , ","& M - ","& M . ","& M / ","& M 5 "," M ","6 M  ","9 M ( ","9 M . M ","9 M / ","9 M 2 ","9 M 5 ", "$ M $ ","$ M $ M ","* M $ ","$ M ( "," M  ", "2 M 2 ","7 M  M 5 "," M  M 7 "," M ( ","& M , M 0 "," M 0 ", "7 M  M 0 ","9 M ( "," < M ","9 M 5 ","& M & ", "6 M 0 "," M 0 ","! M 0 ","" M 0 ", " M  ","& M ' ","d ","M 0 ","M 0 ", " "," "," "," "," "," ","  "," "," "," "," "," ","` "," "," "," ", " M ", " "," M "," "," M "," "," "," M "," ", " M  M "," M "," "," "," M  M "," M "," M "," "," "," M "," "," M ", " "," ","! ","" ","# ","# M ", "$ M ","$ ","% M ","% ","& ","& ","' M ","' ","( M ( ","( M ( M ","( ","( ","( M ", "* M ","* ","+ M ","+ ",", M ",", ","- M ","- ",". M ",". ", "/ M ","/ ","0 ","2 M ","2 ","2 ","3 ","5 M ","5 ", "6 ","6 ","6 ","6 M ","6 M ","7 M ","7 ","8 M ","8 ","9 ","9 M ", " M 7 "," M 7 M ","$ M 0 ","$ M 0 M "," M  "," M  M ","Z", "I ","L ","> ","@ ","A ","B ","A ","B ","C ","D ","b ","G ","H ","K ","L ", " "," "," ",":","< ", "E ","= ","M ","G ", "f ","g ","h ","i ","j ","k ","l ","m ","n ","o ", "0","1","2","3","4","5","6","7","8","9", "G ", "H ", "G ","> ","K ","K ","L ","","A  "," ","K ","K ","  ") var array_one_length = array_one.length ; document.getElementById("Unicode_text").value = "You have chosen SIMPLE TEXT in Chanakya font to convert into Unicode. Conversion in progress.." ; var modified_substring = document.getElementById("legacy_text").value ; //**************************************************************************************** // Break the long text into small bunches of max. max_text_size characters each. //**************************************************************************************** var text_size = document.getElementById("legacy_text").value.length ; var processed_text = '' ; //blank var sthiti1 = 0 ; var sthiti2 = 0 ; var chale_chalo = 1 ; var max_text_size = 4000; while ( chale_chalo == 1 ) { sthiti1 = sthiti2 ; if ( sthiti2 < ( text_size - max_text_size ) ) { sthiti2 += max_text_size ; while (document.getElementById("legacy_text").value.charAt ( sthiti2 ) != ' ') {sthiti2--;} } else { sthiti2 = text_size ; chale_chalo = 0 } var modified_substring = document.getElementById("legacy_text").value.substring ( sthiti1, sthiti2 ) ; Replace_Symbols( ) ; processed_text += modified_substring ; // processed_text = processed_text.replace( /Sanskrit 99/g , "mangal" ) ; document.getElementById("Unicode_text").value = processed_text ; } //-------------------------------------------------- function Replace_Symbols( ) { //substitute array_two elements in place of corresponding array_one elements if ( modified_substring != "" ) // if string to be converted is non-blank then no need of any processing. { // first replace the two-byte nukta_varNa with corresponding one-byte nukta varNas. modified_substring = modified_substring.replace ( / < / , "X " ) ; modified_substring = modified_substring.replace ( / < /g , "Y " ) ; modified_substring = modified_substring.replace ( / < /g , "Z " ) ; modified_substring = modified_substring.replace ( / < /g , "[ " ) ; modified_substring = modified_substring.replace ( /! < /g , "\ " ) ; modified_substring = modified_substring.replace ( /" < /g , "] " ) ; modified_substring = modified_substring.replace ( /( < /g , ") " ) ; modified_substring = modified_substring.replace ( /+ < /g , "^ " ) ; modified_substring = modified_substring.replace ( // < /g , "_ " ) ; modified_substring = modified_substring.replace ( /0 < /g , "1 " ) ; for(input_symbol_idx = 0; input_symbol_idx < array_one_length; input_symbol_idx++ ) { idx = 0 ; // index of the symbol being searched for replacement while (idx != -1 ) //whie-00 { modified_substring = modified_substring.replace( array_one[ input_symbol_idx ] , array_two[input_symbol_idx] ) idx = modified_substring.indexOf( array_one[input_symbol_idx] ) } // end of while-00 loop } // end of for loop //********************************************************************************** // Code for Replacing Special glyph : Z (reph+anusvAr) //********************************************************************************** modified_substring = modified_substring.replace( /Z/g , " " ) ; // at some places is used eg in " 0 M   ' A ,* B 0 M # >   ". //============================================================================================= // code for replacing "" with "? " (chhotee ee kii maatraa) and correcting its position too. var position_of_f = modified_substring.indexOf( "" ) ; while ( position_of_f != -1 ) //while-02 { var charecter_right_to_f = modified_substring.charAt( position_of_f + 1 ) ; modified_substring = modified_substring.replace( "" + charecter_right_to_f , charecter_right_to_f + "? " ) ; position_of_f = position_of_f + 1 ; while ( ( modified_substring.charAt( position_of_f + 1 ) == "M " ) & ( position_of_f < modified_substring.length - 1 ) ) { var string_to_be_replaced = modified_substring.charAt( position_of_f + 1 ) + modified_substring.charAt( position_of_f + 2 ) ; modified_substring = modified_substring.replace( "? " + string_to_be_replaced , string_to_be_replaced + "? " ) ; position_of_f = position_of_f + 2 ; } position_of_f = modified_substring.search( // , position_of_f + 1 ) ; // search for ahead of the current position. } // end of while-02 loop //============================================================= //Eliminating ""(reph) and putting 'half - r' at proper position for this. //following three statement for adjusting position of reph ie, half r . modified_substring = modified_substring.replace( /([         ! \ " ] # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9  M 7  M  ])([> ? @ A B C G H K L   ]*)/g , "$1$2" ) ; modified_substring = modified_substring.replace( /([         ! \ " ] # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9  M 7  M  ])([M ])/g , "$1$2" ) ; modified_substring = modified_substring.replace( //g , "0 M " ) ; }//end of IF statement meant to supress processing of blank string. } // end of the function Replace_Symbols } // end of convert_Chanakya_to_Unicode() function convert_Unicode_to_Krutidev010() { var array_one = new Array( // ignore all nuktas except in ! < and " < " "," "," "," ","(",")","{","}","=","d ","?","-","","p ",",",".","M ", "f ","g ","h ","i ","j ","k ","l ","m ","n ","o ","x","+",";","_", "^ M ","X ","Y ","Z "," < M ","[ ","\ ","] ","^ ","_ ","1 ",") ", // one-byte nukta varNas "$ M $ M ","$ M $ "," M $ ","& C "," C ", "6 M 5 ","9 M ( ","9 M / ","9 C ","9 M . ","9 M 0 ","9 M ","& M & "," M 7 M "," M 7 ","$ M 0 M ","$ M 0 "," M  ", " M / "," M / "," M / ","! M / ","" M / ","& M / ","& M 5 ", "6 M 0 "," M 0 ","! M 0 ","" M 0 "," M 0 "," M 0 ","+ M 0 ","& M 0 ","* M 0 "," M 0 ","0 A ","0 B ", "M 0 ", " "," "," "," "," "," "," "," "," "," "," ", " M "," "," M  "," M "," "," M "," "," M "," "," ", " H "," M "," "," "," M "," "," M "," "," ", " M  "," M "," "," ","! M ! ","! M " ","! ","" ","# M ","# ", "$ M ","$ ","% M ","% ","& M ' ","& ","' M ","' ","( M ","( ", "* M ","* ","+ M ","+ ",", M ",", ","- M ","- ",". M ",". ", "/ M ","/ ","0 ","2 M ","2 ","3 ","5 M ","5 ", "6 M ", "6 ", "7 M ", "7 ", "8 M ", "8 ", "9 ", " ","I ","K ","L ","> ","@ ","A ","B ","C ","G ","H ", " "," "," ","E ","= ","M ","M ","< ","/") var array_two = new Array( "^","*","","","","","","","","A","\\","&","&","R","]","-","~ ", "",""," ","& "," ","! ","","0 ","`","9 ","","$","(","&", // "","d","[k","x","T","t","M+","<+","Q",";","j","u", "+","d+","[k+","x+","T+","t+","M+","<+","Q+",";+","j+","u+", "","k",""," "," ", "o","","","","","z","","","{","{k","","=","K", "N","V","B","M","<","|","}", "J","V","M","<","N","","","","","xz","#",":", "z", "vks","vkS","vk","v","bZ","b","m","",",s",",","_", "D","d","","[","[k","X","x","?","?k","", "pkS","P","p","N","T","t","",">","", "","","V","B","","","M","<",".",".k", "R","r","F","Fk",")","n","","k","U","u", "I","i","","Q","C","c","H","Hk","E","e", "",";","j","Y","y","G","O","o", "'","'k","\"","\"k","L","l","g", "v "," ","ks","kS","k","h","q","w","`","s","S", "a","","%","W","","~ ","~","+","@") // "~j" var array_one_length = array_one.length ; var modified_substring = document.getElementById("Unicode_text").value ; //**************************************************************************************** // Break the long text into small bunches of max. max_text_size characters each. //**************************************************************************************** var text_size = document.getElementById("Unicode_text").value.length ; var processed_text = '' ; //blank var sthiti1 = 0 ; var sthiti2 = 0 ; var chale_chalo = 1 ; var max_text_size = 6000; //************************************************************ // var max_text_size = chunksize; // alert(max_text_size); //************************************************************ while ( chale_chalo == 1 ) { sthiti1 = sthiti2 ; if ( sthiti2 < ( text_size - max_text_size ) ) { sthiti2 += max_text_size ; while (document.getElementById("Unicode_text").value.charAt ( sthiti2 ) != ' ') {sthiti2--;} } else { sthiti2 = text_size ; chale_chalo = 0 } var modified_substring = document.getElementById("Unicode_text").value.substring ( sthiti1, sthiti2 ) ; Replace_Symbols( ) ; processed_text += modified_substring ; // processed_text = processed_text.replace( /mangal/g , "Krutidev010" ) ; document.getElementById("Krutidev010_text").value = processed_text ; } //************************************************** function Replace_Symbols( ) { // if string to be converted is non-blank then no need of any processing. if (modified_substring != "" ) { // first replace the two-byte nukta_varNa with corresponding one-byte nukta varNas. modified_substring = modified_substring.replace ( /$ M 0 M / /g , "/ " ) ; modified_substring = modified_substring.replace ( /6 M 0 M / /g , " z/ " ) ; modified_substring = modified_substring.replace ( / < / , "X " ) ; modified_substring = modified_substring.replace ( / < /g , "Y " ) ; modified_substring = modified_substring.replace ( / < /g , "Z " ) ; modified_substring = modified_substring.replace ( / < /g , "[ " ) ; modified_substring = modified_substring.replace ( /! < /g , "\ " ) ; modified_substring = modified_substring.replace ( /" < /g , "] " ) ; modified_substring = modified_substring.replace ( /( < /g , ") " ) ; modified_substring = modified_substring.replace ( /+ < /g , "^ " ) ; modified_substring = modified_substring.replace ( // < /g , "_ " ) ; modified_substring = modified_substring.replace ( /0 < /g , "1 " ) ; // code for replacing "? " (chhotee ee kii maatraa) with "f" and correcting its position too. var position_of_f = modified_substring.indexOf( "? " ) ; while ( position_of_f != -1 ) //while-02 { var character_left_to_f = modified_substring.charAt( position_of_f - 1 ) ; modified_substring = modified_substring.replace( character_left_to_f + "? " , "f" + character_left_to_f ) ; position_of_f = position_of_f - 1 ; while (( modified_substring.charAt( position_of_f - 1 ) == "M " ) & ( position_of_f != 0 ) ) { var string_to_be_replaced = modified_substring.charAt( position_of_f - 2 ) + "M " ; modified_substring = modified_substring.replace( string_to_be_replaced + "f", "f" + string_to_be_replaced ) ; position_of_f = position_of_f - 2 ; } position_of_f = modified_substring.search( /? / , position_of_f + 1 ) ; // search for f ahead of the current position. } // end of while-02 loop //************************************************************ // modified_substring = modified_substring.replace( /f0 M /g , "" ) ; //************************************************************ // Eliminating "0 M " and putting Z at proper position for this. set_of_matras = "> ? @ A B C G H K L  : E " modified_substring += ' ' ; // add two spaces after the string to avoid UNDEFINED char in the following code. var position_of_half_R = modified_substring.indexOf( "0 M " ) ; // alert(" 21. position_of_half_R = " + position_of_half_R); //************************************************************************************ while ( position_of_half_R > 0 ) // while-03 { // "0 M " is two bytes long var probable_position_of_Z = position_of_half_R + 2 ; var character_at_probable_position_of_Z = modified_substring.charAt( probable_position_of_Z ) // alert(" 3. probable_position_of_Z = "+probable_position_of_Z ); // alert(" 4. character_at_probable_position_of_Z = "+character_at_probable_position_of_Z ); // trying to find non-maatra position right to probable_position_of_Z . while( set_of_matras.match( character_at_probable_position_of_Z ) != null ) // while-04 { probable_position_of_Z = probable_position_of_Z + 1 ; character_at_probable_position_of_Z = modified_substring.charAt( probable_position_of_Z ) ; // alert(" 5. probable_position_of_Z = "+probable_position_of_Z ); // alert(" 6. character_at_probable_position_of_Z = "+character_at_probable_position_of_Z ); } // end of while-04 //************************************************************ // check if the next character is a halant //************************************************************ var right_to_position_of_Z = probable_position_of_Z + 1 ; // alert(" 7. right_to_position_of_Z = "+right_to_position_of_Z ); if (right_to_position_of_Z > 0) // if-03 { var character_right_to_position_of_Z = modified_substring.charAt( right_to_position_of_Z ) // alert(" 8. character_right_to_position_of_Z = "+character_right_to_position_of_Z ); // while ("M ".match( character_right_to_position_of_Z ) != null ) // while-05 while ( character_right_to_position_of_Z == "M " ) // while-05 { // halant found, move to next character probable_position_of_Z = right_to_position_of_Z + 1 ; character_at_probable_position_of_Z = modified_substring.charAt( probable_position_of_Z ) ; // alert(" 9. probable_position_of_Z = "+probable_position_of_Z ); // alert("10. character_at_probable_position_of_Z = "+character_at_probable_position_of_Z ); right_to_position_of_Z = probable_position_of_Z + 1 ; character_right_to_position_of_Z = modified_substring.charAt( right_to_position_of_Z ) // alert("11. right_to_position_of_Z = "+right_to_position_of_Z ); // alert("12. character_right_to_position_of_Z = "+character_right_to_position_of_Z ); } // end of while-05 // alert("121. position_of_half_R = "+position_of_half_R); // alert("122. probable_position_of_Z = "+probable_position_of_Z); } // end of if-03 //************************************************************ string_to_be_replaced = modified_substring.substr ( position_of_half_R + 2,(probable_position_of_Z - position_of_half_R)-1) ; //************************************************************ // check if character_right_to_position_of_Z is a space // if (space.match(character_right_to_position_of_Z) != null) // { // string_to_be_replaced = string_to_be_replaced.substr(0,string_to_be_replaced.length - 1) // alert("13. string_to_be_replaced = "+string_to_be_replaced ); // alert("14. string_to_be_replaced.length ="+string_to_be_replaced.length); // } modified_substring = modified_substring.replace( "0 M " + string_to_be_replaced, string_to_be_replaced + "Z" ) ; // alert("15. string_to_be_replaced = "+string_to_be_replaced ); // alert("16. modified_substring = "+modified_substring ); position_of_half_R = modified_substring.indexOf( "0 M " ) ; // alert("17. position_of_half_R = "+position_of_half_R ) } // end of while-03 //*********************************************************** modified_substring = modified_substring.substr ( 0 , modified_substring.length - 2 ) ; //substitute array_two elements in place of corresponding array_one elements for( input_symbol_idx = 0; input_symbol_idx < array_one_length; input_symbol_idx++ ) { idx = 0 ; // index of the symbol being searched for replacement while (idx != -1 ) //whie-00 { modified_substring = modified_substring.replace( array_one[ input_symbol_idx ] , array_two[input_symbol_idx] ) idx = modified_substring.indexOf( array_one[input_symbol_idx] ) } // end of while-00 loop } // end of for loop } // end of IF statement meant to supress processing of blank string. modified_substring = modified_substring.replace( /Zksa/g , "ksZa" ) ; modified_substring = modified_substring.replace( /~ Z/g , "Z~" ) ; modified_substring = modified_substring.replace( /Zk/g , "kZ" ) ; modified_substring = modified_substring.replace( /Zh/g , "" ) ; } // end of the function Replace_Symbols() } // End of convert_Unicode_to_Kritidev010() } // end of convert_to_Unicode_and_Krutidev010() </script> <!-- ---------------------------------------------------------------------------------- body of the HTML starts here. one text box is provided each for input and output. --> <center> <form name="form1"> <b>Chanakya</b> font text-box<br> <textarea name="TextToConvert" id="legacy_text" cols="92" rows="6"></textarea> <br> <div align="middle"> <input name="converter" id="converter" value=" Convert to Unicode and Krutidev010 &gt;&gt; " onclick="convert_to_Unicode_and_Krutidev010();" accesskey="c" title="6 I 0 M    alt+c" type="button"> </div> <br> <b>Unicode</b> text-box<br> <textarea name="ConvertedText1" id="Unicode_text" cols="92" rows="7"></textarea> <br><br> <b>Krutidev010</b> font text-box<br> <textarea name="ConvertedText2" id="Krutidev010_text" cols="92" rows="7"></textarea> <br> <b>  * ( @ - > 7 >  > * M 0 / K  8 A 5 ? ' >  > & B 8 0 > ( > . 9 H d </b> </form> </center></center></body></html>