Click here to Skip to main content
15,867,870 members
Articles / Desktop Programming / Windows Forms
Tip/Trick

Unicode to Krutidev, Krutidev to Unicode Convertor in C#

Rate me:
Please Sign up or sign in to vote.
4.40/5 (5 votes)
14 Oct 2012CPOL 126.6K   2.4K   2   45
Convertor for Unicode to Krutidev and vice-versa.

Image 1

Introduction

This application is created in C# for solving major problem of Text Conversion from Unicode to Krutidev and vice-versa.

Background

When I was trying to convert Unicode to Krutidev, I could not found any offline / desktop solution for it with the source code, then I created this for the solution by using HTML page with JavaScript, which was available by Rajbhasha.net, using JavaScript for it, and using Browser control for local execution of JavaScript and Firing Event of HTML control.

Unicode_to_Krutidev/krutitounicode.JPG

Unicode_to_Krutidev/unicodetokruti.JPG

Unicode_to_Krutidev/loadshtmlinbrowsercontrol.JPG

Using the code

C#
private string UnicodetoKruti(string strInput)
{
    string strOutPut = "";
    HtmlElementCollection theElementCollection;
    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if ((curElement.GetAttribute("id").ToString() == "unicode_text"))
        {
            curElement.SetAttribute("Value", strInput);
        }

    }
    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if (curElement.GetAttribute("id").Equals("converter"))
        {
            curElement.InvokeMember("click");
            //  javascript has a click method for we need to invoke on button and hyperlink elements.
        }
    }

    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if ((curElement.GetAttribute("id").ToString() == "legacy_text"))
        {
            strOutPut = curElement.GetAttribute("Value");
        }

    }
    return strOutPut;
} 

//this function will convert kruti text to unicode
private string KrutitoUnicode(string strInput)
{
    string strOutPut = "";
    HtmlElementCollection theElementCollection;
    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if ((curElement.GetAttribute("id").ToString() == "legacy_text"))
        {
            curElement.SetAttribute("Value", strInput);
        }
    }
    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if (curElement.GetAttribute("id").Equals("converttounicode"))
        {
            curElement.InvokeMember("click");
            //  javascript has a click method for we need to invoke on button and 
            // hyperlink elements.
        }
    }
    theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
    foreach (HtmlElement curElement in theElementCollection)
    {
        if ((curElement.GetAttribute("id").ToString() == "unicode_text"))
        {
            strOutPut = curElement.GetAttribute("Value");
        }
    }
    return strOutPut;
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
Anurag Tripathi, having programming experience of more then 13+ years, works on Microsoft technologies. Experienced architect for various application like Device application, Mobile Applications, Enterprise Level application. Anurag is having experience of managing team on various platforms like ASP .Net, Silverlight, MVVM, Magento, Wordpress, iPhone, WCF, Android etc.

Comments and Discussions

 
QuestionUNICODE TO KRUTI Pin
Avnish kumar 202320-Jan-23 2:38
Avnish kumar 202320-Jan-23 2:38 
QuestionKruti to Unicode conversion Pin
mahemoda27-Nov-18 20:38
mahemoda27-Nov-18 20:38 
Questionkrutidev to mangal Pin
Member 133900789-Apr-18 21:24
Member 133900789-Apr-18 21:24 
QuestionRe: Conversion Not working Pin
Member 113611168-Jan-15 1:23
Member 113611168-Jan-15 1:23 
AnswerRe: Conversion Not working Pin
AnuragTripathi3-Mar-15 0:42
AnuragTripathi3-Mar-15 0:42 
GeneralRe: Conversion Not working Pin
krishnakantrawat6-Mar-17 2:06
krishnakantrawat6-Mar-17 2:06 
QuestionError in conversion between KrutiDev to Unicode Pin
Member 1104002914-Dec-14 22:48
Member 1104002914-Dec-14 22:48 
QuestionWord Document ( Kriti Dev To mangal Converter) Pin
04ashishsharma12-Jun-14 1:31
04ashishsharma12-Jun-14 1:31 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) Pin
AnuragTripathi17-Jul-14 19:45
AnuragTripathi17-Jul-14 19:45 
QuestionWord Document ( Kriti Dev To mangal Converter) Pin
04ashishsharma6-Jun-14 2:28
04ashishsharma6-Jun-14 2:28 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) Pin
AnuragTripathi17-Jul-14 20:12
AnuragTripathi17-Jul-14 20:12 
Questionis this possible in javascript? Pin
Priyanka_a7-Jan-14 22:26
professionalPriyanka_a7-Jan-14 22:26 
AnswerRe: is this possible in javascript? Pin
AnuragTripathi25-May-14 20:27
AnuragTripathi25-May-14 20:27 
Questionunicode to kruti exe file Pin
Rahul Borele2-Jan-14 7:02
Rahul Borele2-Jan-14 7:02 
AnswerRe: unicode to kruti exe file Pin
AnuragTripathi25-May-14 20:37
AnuragTripathi25-May-14 20:37 
QuestionExe File Pin
Amit Jain1-Jan-14 20:09
Amit Jain1-Jan-14 20:09 
AnswerRe: Exe File Pin
AnuragTripathi25-May-14 20:35
AnuragTripathi25-May-14 20:35 
QuestionExe file Pin
Member 103233938-Oct-13 5:27
Member 103233938-Oct-13 5:27 
AnswerRe: Exe file Pin
AnuragTripathi8-Oct-13 21:01
AnuragTripathi8-Oct-13 21:01 
QuestionExe file Pin
Member 103233933-Oct-13 4:39
Member 103233933-Oct-13 4:39 
AnswerRe: Exe file Pin
AnuragTripathi7-Oct-13 3:03
AnuragTripathi7-Oct-13 3:03 
GeneralRe: Exe file Pin
Member 1066917113-Mar-14 20:19
Member 1066917113-Mar-14 20:19 
GeneralRe: Exe file Pin
AnuragTripathi25-May-14 20:41
AnuragTripathi25-May-14 20:41 
Questionplz help me Pin
Member 102462891-Sep-13 19:00
Member 102462891-Sep-13 19:00 
AnswerRe: plz help me Pin
AnuragTripathi7-Oct-13 3:03
AnuragTripathi7-Oct-13 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.