Click here to Skip to main content
Click here to Skip to main content

Unicode to Krutidev, Krutidev to Unicode Convertor in C#

By , 14 Oct 2012
Rate this:
Please Sign up or sign in to vote.

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

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)

About the Author

AnuragTripathi
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

 
Questionis this possible in javascript? PinmemberPriyanka_sepl7-Jan-14 22:26 
Questionunicode to kruti exe file PinmemberRahul Borele2-Jan-14 7:02 
QuestionExe File PinmemberAmit Jain1-Jan-14 20:09 
QuestionExe file [modified] PinmemberMember 103233938-Oct-13 5:27 
AnswerRe: Exe file PinmemberAnuragTripathi8-Oct-13 21:01 
QuestionExe file PinmemberMember 103132023-Oct-13 4:39 
AnswerRe: Exe file PinprofessionalAnuragTripathi7-Oct-13 3:03 
GeneralRe: Exe file PinmemberMember 1066917113-Mar-14 20:19 
Questionplz help me PinmemberMember 102462891-Sep-13 19:00 
AnswerRe: plz help me PinprofessionalAnuragTripathi7-Oct-13 3:03 
QuestionHelp me PinmemberMember 824086014-Jun-13 9:32 
AnswerRe: Help me PinprofessionalAnuragTripathi21-Jun-13 20:41 
QuestionGreat App, but one question! [modified] Pinmemberishgoel3-Jun-13 22:14 
AnswerRe: Great App, but one question! PinprofessionalAnuragTripathi21-Jun-13 20:43 
Questionplease help me Pinmemberdevraj13046-Dec-12 23:09 
AnswerRe: please help me PinmemberAnuragTripathi7-Dec-12 18:41 
GeneralRe: please help me Pinmemberdevraj13049-Dec-12 2:56 
GeneralRe: please help me PinmemberAnuragTripathi9-Dec-12 19:51 
GeneralRe: please help me Pinmemberdevraj130414-Dec-12 2:47 
GeneralRe: please help me PinmemberAnuragTripathi16-Dec-12 19:28 
GeneralRe: please help me PinmemberAnuragTripathi16-Dec-12 19:46 
QuestionGr8 work PinmemberMember 329661722-Oct-12 7:51 
Bugdoes not download Pinmembermanishcodepro6-Oct-12 22:35 
GeneralRe: does not download PinmemberAnuragTripathi11-Oct-12 3:58 
GeneralRe: does not download PinmemberAnuragTripathi14-Oct-12 0:46 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 14 Oct 2012
Article Copyright 2012 by AnuragTripathi
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid