Click here to Skip to main content
11,705,473 members (60,985 online)
Click here to Skip to main content

Unicode to Krutidev, Krutidev to Unicode Convertor in C#

, 14 Oct 2012 CPOL 29.7K 1.1K 2
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.

You may also be interested in...

Comments and Discussions

 
QuestionRe: Conversion Not working Pin
Member 113611168-Jan-15 1:23
memberMember 113611168-Jan-15 1:23 
AnswerRe: Conversion Not working Pin
AnuragTripathi3-Mar-15 0:42
memberAnuragTripathi3-Mar-15 0:42 
QuestionError in conversion between KrutiDev to Unicode Pin
Member 1104002914-Dec-14 22:48
memberMember 1104002914-Dec-14 22:48 
QuestionWord Document ( Kriti Dev To mangal Converter) Pin
04ashishsharma12-Jun-14 1:31
member04ashishsharma12-Jun-14 1:31 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) Pin
AnuragTripathi17-Jul-14 19:45
memberAnuragTripathi17-Jul-14 19:45 
QuestionWord Document ( Kriti Dev To mangal Converter) Pin
04ashishsharma6-Jun-14 2:28
member04ashishsharma6-Jun-14 2:28 
AnswerRe: Word Document ( Kriti Dev To mangal Converter) Pin
AnuragTripathi17-Jul-14 20:12
memberAnuragTripathi17-Jul-14 20:12 
Questionis this possible in javascript? Pin
Priyanka_sepl7-Jan-14 22:26
memberPriyanka_sepl7-Jan-14 22:26 
AnswerRe: is this possible in javascript? Pin
AnuragTripathi25-May-14 20:27
memberAnuragTripathi25-May-14 20:27 
Questionunicode to kruti exe file Pin
Rahul Borele2-Jan-14 7:02
memberRahul Borele2-Jan-14 7:02 
AnswerRe: unicode to kruti exe file Pin
AnuragTripathi25-May-14 20:37
memberAnuragTripathi25-May-14 20:37 
QuestionExe File Pin
Amit Jain1-Jan-14 20:09
memberAmit Jain1-Jan-14 20:09 
AnswerRe: Exe File Pin
AnuragTripathi25-May-14 20:35
memberAnuragTripathi25-May-14 20:35 
QuestionExe file Pin
Member 103233938-Oct-13 5:27
memberMember 103233938-Oct-13 5:27 
AnswerRe: Exe file Pin
AnuragTripathi8-Oct-13 21:01
memberAnuragTripathi8-Oct-13 21:01 
QuestionExe file Pin
Member 103132023-Oct-13 4:39
memberMember 103132023-Oct-13 4:39 
AnswerRe: Exe file Pin
AnuragTripathi7-Oct-13 3:03
professionalAnuragTripathi7-Oct-13 3:03 
GeneralRe: Exe file Pin
Member 1066917113-Mar-14 20:19
memberMember 1066917113-Mar-14 20:19 
GeneralRe: Exe file Pin
AnuragTripathi25-May-14 20:41
memberAnuragTripathi25-May-14 20:41 
Questionplz help me Pin
Member 102462891-Sep-13 19:00
memberMember 102462891-Sep-13 19:00 
AnswerRe: plz help me Pin
AnuragTripathi7-Oct-13 3:03
professionalAnuragTripathi7-Oct-13 3:03 
QuestionHelp me Pin
Member 824086014-Jun-13 9:32
memberMember 824086014-Jun-13 9:32 
AnswerRe: Help me Pin
AnuragTripathi21-Jun-13 20:41
professionalAnuragTripathi21-Jun-13 20:41 
QuestionGreat App, but one question! Pin
ishgoel3-Jun-13 22:14
memberishgoel3-Jun-13 22:14 
AnswerRe: Great App, but one question! Pin
AnuragTripathi21-Jun-13 20:43
professionalAnuragTripathi21-Jun-13 20:43 

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