<html> <head>/ B ( ?  K ! 8 G DV-TTYogeshEN + < K # M  * 0 ? 5 0 M $ ? $ M 0 (16-2-2008 15:53) </title> <script type="text/javascript"> // modified on 05/02/2013 function convert_to_YogeshEN() { //var chunksize = document.getElementById("chunksize").value; var array_one = new Array( " < M "," < M "," < M "," < M ","+ < M "," < "," < "," < "," < ","+ < ","! < ","" < ", // two-byte varnas "P ","= "," ","d ","6 M 0 M ","6 M 0 "," ","I ", "  ","  "," "," "," "," "," "," "," "," "," ","` "," "," ", " M 0 "," M $ "," M 7 M "," M 7 ","X M ","X "," M "," ","Y M ","Y "," M 0 M "," M "," ","Z M ","Z "," M 0 M "," M 0 "," M "," "," M 0 M "," M "," "," ", " M 0 M "," M "," "," ","[ M ","[ "," M 0 M "," M  M "," M  "," M "," "," M 0 M "," M "," "," M "," ", " M  "," M "," "," M "," ","\ ","! M ! ","! M " ","! ","] ","" ","# M ","# ", "$ M 0 M ","$ M 0 ","$ M $ M ","$ M $ ","$ M ","$ ","% M 0 M ","% M ","% ","& C ","& M 0 ","& M & ","& M ' ","& M . ","& M / ","& M 5 ","& ","' M 0 M ","' M ","' ","( M 0 M ","( M ( M ","( M ( ","( M ","( ", "* M 0 M ","* M 0 ","* M ","* ","^ M 0 ","+ M 0 ","^ M ","^ ","+ M ","+ ",", M 0 ",", M ",", ","- M 0 M ","- M ","- ",". M 0 M ",". M ",". ", //"M / ","0 M ", "/ M 0 M ","/ M ","/ ","0 A ","0 B ","2 M ","2 ","3 M ","3 ","5 M 0 M ","5 M ","5 ", "6 M 5 M ","6 M 5 ","6 M ","6 ","7 M ","7 ","8 M ","8 ", "9 C ","9 M 0 ","9 M . ","9 M / ","9 M ","9 ","M 0 ","0 ", " "," ", // "","","", // "@  ","0 M @ ","0 M @  ", //"0 M ","0 M ","0 M ","0 M ", // "F ","F  ","0 M F ","0 M F  ","G ","G  ","0 M G ","0 M G  ","H ","H  ","0 M H ","0 M H  ","E ","E  ","0 M E ","0 M E  ", "G  ","H  ","G ","H ","K ","L ","> ","@ ","A ","B ","C ","D ","E ","M ") var array_two = new Array( "X M ","Y M ","Z M ","[ M ","^ M ","X ","Y ","Z ","[ ","^ ","\ ","] ", // one-byte varnas "$","%","&","*","","","+","", " "," ","+","+","+","+","<","<",">","=","@","A","B","B", "G","H","I","I","D","F","C","E","K","K","L","J","J","N","N","O","O","M","M","Q","P","P","R", "T","S","S","U","W","W","X","Y","Y","V","V","[","Z","Z","\\","\\", "^","_","]","a","`","c","d","e","b","g","f","h","h", "j","j","k","k","i","i","m","l","l","o","p","q","r","s","t","u","n","w","v","v","y","z","z","x","x", "|","|","{","{","","","~","","}","","","","","","","","","","", //"","", "","","","","","","","","","","","", "" ","" ","","","","","","", "","","","","","","","", "","", // "","","", //"","","","", // "","","","","","","","","","","","","","","","", "","","","","","","","","","","","","","") //************************************************************************************** // The following two characters are to be replaced through proper checking of locations: //************************************************************************************** // "0 M " (reph) // "" // // "? " // "" or "" //************************************************************************************** var array_one_length = array_one.length ; document.getElementById("unicode_text").value = "You have chosen SIMPLE TEXT in DV-TTYogeshEN 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 = 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("legacy_text").value.charAt ( sthiti2 ) != ' ') {sthiti2--;} } else { sthiti2 = text_size ; chale_chalo = 0 } var modified_substring = document.getElementById("legacy_text").value.substring ( sthiti1, sthiti2 ) ; // alert(" modified substring ="+modified_substring); Replace_Symbols( ) ; processed_text += modified_substring ; //**************************************************************************************** // Breaking part code over //**************************************************************************************** document.getElementById("unicode_text").value = processed_text ; } //************************************************** //-------------------------------------------------- //************************************************** function Replace_Symbols( ) { // if string to be converted is non-blank then no need of any processing. if (modified_substring != "" ) { // alert(" modified substring2 ="+modified_substring); //" < M "," < M "," < M "," < M ","+ < M "," < "," < "," < "," < ","+ < ","! < ","" < ", // two-byte nuqta_varnas // "X M ","Y M ","Z M ","[ M ","^ M ","X ","Y ","Z ","[ ","^ ","\ ","] ", // one-byte nuqta_varnas // first replace the two-byte nuqta_varNas 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 " ) ; // code for replacing "? " (chhotee ee kii maatraa) with "" 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 + "? " , "" + character_left_to_f ) ; // alert(" modified substring3 ="+modified_substring); 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 + "", "" + string_to_be_replaced ) ; position_of_f = position_of_f - 2 ; // alert(" modified substring4 ="+modified_substring); } 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 "" 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 " ) ; while ( position_of_half_R > 0 ) // while-04 { // "0 M " is two bytes long var probable_position_of_Z = position_of_half_R + 2 ; var character_right_to_probable_position_of_Z = modified_substring.charAt( probable_position_of_Z + 1 ) // trying to find non-maatra position right to probable_position_of_Z . while ( set_of_matras.indexOf( character_right_to_probable_position_of_Z ) != -1 ) { probable_position_of_Z = probable_position_of_Z + 1 ; character_right_to_probable_position_of_Z = modified_substring.charAt( probable_position_of_Z + 1 ) ; } // end of while-05 string_to_be_replaced = modified_substring.substr ( position_of_half_R + 2 , ( probable_position_of_Z - position_of_half_R - 1 )) ; modified_substring = modified_substring.replace( "0 M " + string_to_be_replaced , string_to_be_replaced + "" ) ; position_of_half_R = modified_substring.indexOf( "0 M " ) ; } // end of while-04 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 // alert(" modified substring last ="+modified_substring); } // end of IF statement meant to supress processing of blank string. } // 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"> Put the UNICODE text (plain text or HTML text) in the box below : <br/> <textarea name="TextToConvert" id="legacy_text" cols="80" rows="7"></textarea> <br> <div align="middle"> <input type="button" id="converter" name="converter" value=" Convert to DV-TTYogeshEN font >> " onClick="convert_to_YogeshEN();" accesskey="c" title="6 I 0 M    alt+c"> </div> <br> <div id="hiddenLayer"></div><br> The above text converted to DV-TTYogeshEN font is shown in the box below : <br/> <textarea name="ConvertedText" id="unicode_text" cols="100" rows="13"></textarea> <br /><br /> </form> </body> </html>