<html> <head> <title>4CGandhi <=> / B ( ?  K ! * 0 ? 5 0 M $ ? $ M 0 </title> <B><Font color = darkblue><CENTER>4CGandhi <==> / B ( ?  K ! + < K # M  * 0 ? 5 0 M $ ? $ M 0 (12-01-2009)</font></B> <br> Last update: 31-01-2015<br><br> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <body bgcolor="yellow"> <!--"00FF00" for green --> <script type="text/javascript"> function convert_to_unicode() { var array_one = new Array( "X" , "" , // spacer after ra, ha etc? //"Y" , "" , // bakuli of ka, pha and uu. "" , "X M " , "IY" , "X " , "J" , "Y " , "" , "Y M " , "f" , "Z " , "" , "Z M " , "" , "^ M " , "RY" , "^ " , "" , "Y M " , "J" , "Y " , "O" , "\ " , "P" , "] " , "f" , "[ " , "" , "[ M " , "n" , "2 M 2 " , "o" , " M . " , "p" , "8 M 0 " , "{" , "$ M 0 " , "}" , "$ M ( " , "~" , "* M $ " , "\ " , " M  " , "" , " M  " , " " , " M  " , "& " , " M  " , " " , " M  M $ " , "! " , " M  " , "" , " M  " , "0 " , "9 M ( " , "`" , "& M , M 0 " , "9 " , "" M " " , "R" , " M 5 " , " " , "9 M / " , " " , "9 M # " , " " , "9 M 2 " , " " , "9 M 5 " , " " , " M 0 " , "" , " M  " , ""!" , " M " , "a" , "9 M . M " , "\: " , "6 M  " , "S" , " M 0 " , "" , " M 0 M " , "" , " M ( M " , "" , " M  M " , "" , " M  M " , "" , "$ M 0 M " , "" , " M 7 M " , "" , " M  M " , "" , "7 M  M 5 " , "" , "9 M 0 " , "" , "( M ( M " , "X" , "$ M $ M " , "" , "6 M 0 M " , "" , "7 M  " , "" , "7 M " , "" , "6 M 2 " , "" , "6 M 5 " , "" , "8 M $ M 0 " , "" , " M  " , "" , "! M ! " , "" , "! M " " , "" , " M 5 " , "" , "8 M 0 " , "" , "M / " , "" , " M  " , "" , "& M  " , "" , "& M  " , "" , "& M & " , "" , "& M ' " , "" , "& M , " , "" , "& M - " , "" , "& M . " , "" , "& M / " , "" , "& M 5 " , "" , " M $ " , "" , "9 C " , "" , "& C " , "" , " M " , "Y" , "0 A " , "Y" , "0 B " , /* "L" , " M 0 " , "M" , " M 0 " , "O" , "! M 0 " , "P" , "" M 0 " , */ "" , "M 0 " , // below the letter "C" , "M 0 " , "i" , "M 0 " , "j" , "M ( " , "" , "M 2 " , "" , " M " , "IY" , " " , "I" , "5 " , "A" , " M " , "J" , " " , "" , " M " , "" , " M " , "K" , " " , "" , " M " , "L" , " " , "^" , " M " , "" , " " , "" , " M " , "" , " M " , "M" , " " , "N" , " " , "O" , "! " , "P" , "" " , "{" , "# M " , "" , "$ M " , "" , "% M " , "Q" , "& " , "" , "& " , "" , "' M " , "B" , "( M " , "" , "* M " , "" , "+ M " , "RY" , "+ " , "R" , "* " , "" , ", M " , "" , "- M " , "" , ". M " , "" , "/ M " , "S" , "0 " , "" , "2 M " , "" , "2 " , "" , "3 M " , "T" , "3 " , "" , "5 M " , "U" , "5 " , "V" , "6 M " , "" , "6 M " , "" , "6 " , "" , "7 M " , "T" , "8 M " , "" , "9 M " , "W" , "9 " , //added on 31-01-2015 "" , "/ M " , "" , "( M " , "" , "# M " , "" , "8 M " , "" , " M " , "" , "5 M " , "" , "' M " , // should it be ' ? "" , "$ M $ M " , "" , " M " , "" , " M 7 M " , "" , " M " , "" , "0 B " , // 0 A "" , " M " , "" " , "- M " , "k" , " " , "l" , " " , /* @  } x */ // "" , "P " , "" , "= " , "" , "d " , "" , "e " , "" , "p " , "B" , " " , // 31-01-2015 "B" , " " , "B" , " " , "C" , " " , "DY" , " " , "EZ" , " " , "Em" , " " , "E|" , " " , "E" , " " , "F" , " " , "G" , "` " , "H" , " " , "e" , "@ " , "b" , "A " , "c" , "B " , "" , "A " , "" , "B " , "" , "C " , // 31-01-2015 " " , "C " , "Z" , "G " , "m" , "G " , "|" , "G " , "`" , "H " , "" , "K " , // 31-01-2015 "q" , "K " , "" , "L " , "a" , " " , "h" , " " , "g" , "E " , "" , "M " , "" , " " , "" , " " , "b" , "< " , "M f" , "" , "M K " , "G " , "M L " , "H " , "fE " , "I " , "E f" , "I " , "fG " , "K " , "fH " , "L " , "Af" , " " , "AK " , " " , "AL " , " " , "A" , " " , "f" , "> " , // Remove typing mistakes in the original file "A A " , "A " , "B B " , "B " , "C C " , " " , "G G " , "G " , "H H " , "H " , "  " , " " , "  " , " " , " > " , ">  " , " A " , "A  " , " B " , "B  " , " C " , "C  " , " G " , "G  " , " H " , "H  " , " > " , ">  " , " A " , "A  " , " B " , "B  " , " C " , "C  " , " G " , "G  " , " H " , "H  " , "E  " , " " , " E " , " " , "H > " , "L " , "G > " , "K " , "" , " " , // (reph+anusvAr) "" , "0 M d" , // (? +reph) "" , "0 M " , // (reph+ikAr+anusvAr "0 M ?  ") //"" , "d " , // ("?  ") "q" , "f " , "r" , "g " , "s" , "h " , "t" , "i " , "u" , "j " , "v" , "k " , "w" , "l " , "x" , "m " , "y" , "n " , "z" , "o " ) var array_one_length = array_one.length ; 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 = 6000; 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 ) != '\n')&(document.getElementById("legacy_text").value.charAt( sthiti2 ) != '\t')&(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 ; //*************************************************************** // Breaking part code over //*************************************************************** 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 stringto be converted is non-blank then no need of any processing. { // this one for ka, pha, and uu. modified_substring = modified_substring.replace( /([abcgh ZmCi\|`]+)([Y])/g , "$2$1" ) for ( input_symbol_idx = 0; input_symbol_idx < array_one_length-1; input_symbol_idx=input_symbol_idx+2 ) { 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_one[input_symbol_idx+1] ) idx = modified_substring.indexOf( array_one[input_symbol_idx] ) } // end of while-00 loop } // end of for loop // following statements for adjusting postion of i maatraas. modified_substring = modified_substring.replace( /([d])([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])/g , "$2$1" ) ; modified_substring = modified_substring.replace( /([d])((M [           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])+)/g , "$2$1" ) ; modified_substring = modified_substring.replace( /d/g , "? " ) ; modified_substring = modified_substring.replace( //g , "?  " ) ; //following three statement for adjusting position of reph ie, half r . modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])([> ? @ A B C G H K L   ]*)([])/g , "$3$1$2" ) ; modified_substring = modified_substring.replace( /(([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ][M ])+)([])/g, "$3$1" ) ; // Z is $3 here, NOT $2. modified_substring = modified_substring.replace( //g , "0 M " ) ; modified_substring = modified_substring.replace( //g , "0 M " ) ; modified_substring = modified_substring.replace( /([ ]+)([> ? @ A B C G H K L ])/g , "$2" ); // remove maatras typed wrongly //modified_substring = modified_substring.replace( /([  p ])([> ? @ A B C G H K L ])/g , "$2$1" ); //modified_substring = modified_substring.replace( /([? @ A B C G H K L   ])([> ? @ A B C G H K L ])/g , "$1" ) ; } // end of IF statement meant to supress processing of blank string. } // end of the function Replace_Symbols } // end of 4CGandhi_to_unicode function //****************************************************************************** function Convert_to_4CGandhi() { var array_one = new Array( /* " < M " , "X M " , " < M " , "Y M " , " < M " , "Z M " , " < M " , "[ M " , "! < M " , "\ M " , "" < M " , "] M " , "+ < M " , "^ M " , " < " , "X " , " < " , "Y " , " < " , "Z " , " < " , "[ " , "! < " , "\ " , "" < " , "] " , "+ < " , "^ " , */ "\ " , "OX" , "] " , "PX" , "P " , "" , "= " , "" , "d " , "" , "e " , "" , "p " , "" , "9 M 5 " , " " , "9 M 2 " , " " , "9 M 0 " , "" , "9 M / " , " " , "9 M . M " , "a" , "9 M . " , "af" , "9 M ( " , "0 " , "9 M # " , " " , "9 C " , "" , "8 M 0 " , "p" , //"8 M 0 " , "" , "8 M $ M 0 " , "" , "7 M " , "" , "7 M  M 5 " , "" , "7 M  " , "" , "6 M 5 " , "" , "6 M 2 " , "" , "6 M 0 M " , "" , "6 M 0 " , "f" , "6 M  " , ": " , "6 C " , "" , "2 M 2 " , "n" , "0 B " , "Y" , "0 A " , "Y" , "+ M 0 " , "RiY" , "* M $ " , "~" , "( M ( M " , "" , "& M 5 " , "" , "& M / " , "" , "& M . " , "" , "& M - " , "" , "& M , M 0 " , "`" , "& M , " , "" , "& M ' " , "" , "& M & " , "" , "& M  " , "" , "& M  " , "" , "& C " , "" , "$ M 0 M " , "" , "$ M 0 " , "{" , "$ M ( " , "}" , "$ M $ M " , "" , "$ M $ " , "f" , "" M " " , "9 " , "! M " " , "" , "! M ! " , "" , " M " , "" , " M " , ""!" , " M  " , "" , " M  " , "" , " M  " , "! " , " M 0 " , "\ " , " M  M " , "" , " M  " , "f" , " M  M " , "" , " M 5 " , "R" , " M  M " , "" , " M . " , "o" , " M  " , "& " , " M  " , " " , " M  " , "" , " M  M $ " , " " , " M  " , "\ " , " M 0 M " , "" , " M ( M " , "" , " M 7 M " , "" , " M 7 " , "f" , " M 5 " , "" , " M 0 " , "IiY" , " M $ " , "Y" , " M  " , "Y" , " M  " , "Y" , // " M 0 " , "LX" , " M 0 " , "MX" , "! M 0 " , "OX" , "" M 0 " , "PX" , "M 0 " , "i" , "M / " , "" , "M ( " , "j" , "M 2 " , "" , /* " A " , "IbY" , " B " , "IcY" , " C " , "IY" , " G " , "IZY" , " H " , "I`Y" , "  " , "IhY" , "  " , "IaY" , "+ A " , "RbY" , "+ B " , "RcY" , "+ G " , "RZY" , "+ H " , "R`Y" , "+  " , "RhY" , "+  " , "RaY" , */ "X M " , "" , "X " , "I" , "Y M " , "" , "Y " , "J" , //"Y M " , "" , //"Y " , "J" , "Z M " , "" , "Z " , "f" , "[ M " , "" , "[ " , "f" , "^ M " , "" , "^ " , "R" , " M " , "" , " " , "IY" , " M " , "" , " " , "J" , " M " , "" , " " , "f" , " M " , "" , " " , "f" , " " , "K" , " M " , "" , " " , "f" , " " , "L" , " M " , "" , " " , "" , " M " , "" , " " , "f" , " M " , "" , " " , "f" , " " , "MX" , " " , "NX" , "! " , "OX" , "" " , "PX" , "# M " , "" , "# " , "f" , "$ M " , "" , "$ " , "f" , "% M " , "" , "% " , "f" , "& " , "Q" , "' M " , "" , "' " , "f" , "( M " , "" , "( " , "f" , "* M " , "" , "* " , "f" , "+ M " , "" , "+ " , "RY" , ", M " , "" , ", " , "f" , "- M " , "" , "- " , "f" , ". M " , "" , ". " , "f" , "/ M " , "" , "/ " , "f" , "0 " , "SX" , "2 M " , "" , "2 " , "X" , "3 M " , "" , "3 " , "T" , "5 M " , "" , "5 " , "U" , "6 M " , "V" , "6 " , "Vf" , "7 M " , "" , "7 " , "f" , "8 M " , "" , "8 " , "f" , "9 M " , "" , "9 " , "WX" , " " , "A" , " " , "A" , " " , "Afg" , " " , "Af" , " " , "A" , "  " , "BX" , " " , "BX" , " " , "BX" , " " , "CX" , "  " , "DhY" , "  " , "DaY" , " " , "DY" , " " , "EZ" , " " , "E" , " " , "FY" , "` " , "GY" , " " , "H" , "I " , "fg" , "> " , "f" , "@ " , "e" , "A " , "b" , "B " , "c" , "C " , "" , "G " , "Z" , "H " , "`" , "K " , "" , "L " , "" , " " , "a" , " " , "h" , " " , ":" , "E " , "g" , "M " , "" , " " , "" , " " , "" , "< " , "" , // "" "f " , "q" , "g " , "r" , "h " , "s" , "i " , "t" , "j " , "u" , "k " , "v" , "l " , "w" , "m " , "x" , "n " , "y" , "o " , "z" ) var array_one_length = array_one.length ; var modified_substring = document.getElementById("unicode_text").value + " " ; // an space added to help recognise halant at the end of file document.getElementById("legacy_text").value = "Conversion in progress.." ; //************************************************************* // Break the long text into small bunches of max. max_text_size characters each. //************************************************************* var text_size = modified_substring.length ; var processed_text = '' ; //blank var sthiti1 = 0 ; var sthiti2 = 0 ; var chale_chalo = 1 ; var max_text_size = 6000; 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 ) != '\n')&(document.getElementById("unicode_text").value.charAt( sthiti2 ) != '\t')&(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 ) ; //********************************************************** // Breaking part code over //********************************************************** Replace_Symbols( ) ; processed_text += modified_substring ; document.getElementById("legacy_text").value = processed_text ; } //************************************************** function Replace_Symbols( ) { // if string to be converted is non-blank then no need of any processing. if (modified_substring != "" ) { // replace the two-byte nukta_varNa with corresponding one-byte nukta varNas. modified_substring = modified_substring.replace ( / < /g , "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( ' ' + 'M ' + '< ' , '[ M ' ) ; 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 " ) ; // These two to avoid conversion of 0 M into . modified_substring = modified_substring.replace ( /$ M 0 M /g , "" ) ; modified_substring = modified_substring.replace ( /6 M 0 M /g , "" ) ; modified_substring = modified_substring.replace( /0 M /g , "" ) ; modified_substring = modified_substring.replace ( //g , "$ M 0 M " ) ; modified_substring = modified_substring.replace ( //g , "6 M 0 M " ) ; // following statements for adjusting postion of i maatraas. modified_substring = modified_substring.replace( /?  /g , "" ) ; modified_substring = modified_substring.replace( /? /g , "d" ) ; modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])([d])/g , "$2$1" ) ; modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])(M )([d])/g , "$3$1$2" ) ; modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])(M )([d])/g , "$3$1$2" ) ; modified_substring = modified_substring.replace( /d/g , "" ) ; modified_substring = modified_substring.replace( //g , "" ) ; // ************** //following three statement for adjusting position of reph ie, half r . modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])([M ])/g , "$1$2" ) ; modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])([M ])/g , "$1$2" ) ; modified_substring = modified_substring.replace( /([           ! " # $ % & ' ( * + , - . / 0 2 3 5 6 7 8 9 X Y Z [ \ ] ^ _ 1 ) ])([> E @ A B C G H K L   ]*)/g , "$1$2" ) ; modified_substring = modified_substring.replace( / /g , "" ) ; //rem changing 5 to  and * to + etc /* //modified_substring = modified_substring.replace( / M 0 ([^A B C D G H  & ])/g , "$1" ); modified_substring = modified_substring.replace( / M 0 ([A B C D G H  & ]*)/g , "Ii$1Y" ); modified_substring = modified_substring.replace( /X M 0 ([A B C D G H  & ]*)/g , "Ii$1Y" ); //modified_substring = modified_substring.replace( /+ M 0 ([^A B C D G H  & ])/g , "$1" ); modified_substring = modified_substring.replace( /+ M 0 ([A B C D G H  & ]*)/g , "Ri$1Y" ); modified_substring = modified_substring.replace( /^ M 0 ([A B C D G H  & ]*)/g , "Ri$1Y" ); modified_substring = modified_substring.replace( / M $ ([A B C D G H  & ]*)/g , "$1Y" ); //modified_substring = modified_substring.replace( / ([^A B C D G H  & ])/g , "d$1" ); modified_substring = modified_substring.replace( / ([A B C D G H  & ]*)/g , "I$1Y" ); modified_substring = modified_substring.replace( / ([A B C D G H  & ]*)/g , "I$1Y" ); modified_substring = modified_substring.replace( /+ ([A B C D G H  & ]*)/g , "R$1Y" ); modified_substring = modified_substring.replace( /^ ([A B C D G H  & ]*)/g , "R$1Y" ); */ // Halanta after which there is no constant but space, hypen, comma or full-stop etc modified_substring = modified_substring.replace ( /[M ]([ \,\;\.d \n\-\:])/g , "$1" ) ; // Now substitute Roman symbols for corresponding Devanagari symbols given in array_one. for( input_symbol_idx = 0; input_symbol_idx < array_one_length; input_symbol_idx = input_symbol_idx + 2 ) { 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_one[input_symbol_idx + 1] ) 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. // this one for ka, pha, and uu. modified_substring = modified_substring.replace( /([XY]+)([abcgh ZmCi\|`]+)/g , "$2$1" ) /* modified_substring = modified_substring.replace( /Zks/g , "ksZ" ) ; modified_substring = modified_substring.replace( /~ Z/g , "Z~" ) ; modified_substring = modified_substring.replace( /Zk/g , "kZ" ) ; */ } // end of the function Replace_Symbols( ) } // end of Convert_Unicode_to_Krutidev010 function </script> </head> <!-- ---------------------------------------------------------------------------------- body of the HTML starts here. one text box is provided each for input and output. --> <body> <form name="form1"> <b>4CGandhi</b> font text-box<br/> <textarea name="TextToConvert" id="legacy_text" cols="80" rows="6"></textarea> <br> <div align="middle"> <input type="button" name="converter" id="converter1" value=" Convert to Unicode >> " onClick="convert_to_unicode();" accesskey="c" title="6 I 0 M    alt+c"> </div> <br> <b>Unicode</b> text-box<br/> <textarea name="ConvertedText" id="unicode_text" cols="80" rows="6"></textarea> <br /> <div align="middle"> <input type="button" id="converter2" name="converter" value=" Convert to 4CGandhi >> " onClick="Convert_to_4CGandhi();" accesskey="c" </div> </form> </body> </html>