Click here to Skip to main content
Click here to Skip to main content
Go to top

Unicode to Krutidev, Krutidev to Unicode Convertor in C#

, 14 Oct 2012
Rate this:
Please Sign up or sign in to vote.
Convertor for Unicode to Krutidev and vice-versa.

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)

Share

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

 
QuestionWord Document ( Kriti Dev To mangal Converter) Pinmember04ashishsharma12-Jun-14 1:31 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) PinmemberAnuragTripathi17-Jul-14 19:45 
QuestionWord Document ( Kriti Dev To mangal Converter) Pinmember04ashishsharma6-Jun-14 2:28 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) PinmemberAnuragTripathi17-Jul-14 20:12 
Questionis this possible in javascript? PinmemberPriyanka_sepl7-Jan-14 22:26 
AnswerRe: is this possible in javascript? PinmemberAnuragTripathi25-May-14 20:27 
Questionunicode to kruti exe file PinmemberRahul Borele2-Jan-14 7:02 
AnswerRe: unicode to kruti exe file PinmemberAnuragTripathi25-May-14 20:37 
QuestionExe File PinmemberAmit Jain1-Jan-14 20:09 
AnswerRe: Exe File PinmemberAnuragTripathi25-May-14 20:35 
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 
GeneralRe: Exe file PinmemberAnuragTripathi25-May-14 20:41 
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 
Hi Anurag. really its so good program but can u tell me how i can download the program not source code. i downloded zip file but it was source code. please mail me. thanks Smile | :)
AnswerRe: please help me PinmemberAnuragTripathi7-Dec-12 18:41 
GeneralRe: please help me Pinmemberdevraj13049-Dec-12 2:56 

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
Web02 | 2.8.140926.1 | Last Updated 14 Oct 2012
Article Copyright 2012 by AnuragTripathi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid