Solved

Decoding the encoded characters

Posted on 2011-09-14
2
151 Views
Last Modified: 2012-10-31
Hello,
I have encoded the foreign characters.  i need help with decoding.

Dim tst As String = HtmlEncode(text)

Private Function HtmlEncode(ByVal Text As String) As String
        Dim i As Integer
        Dim sb As New StringBuilder
        'Split the string into a char array.
        Dim charCode As String
        Dim charArray() As Char = Text.ToCharArray()

        'Note: Remember zero based index. Also remember length minus one to prevent out of bounds exception
        For i = 0 To charArray.Length - 1 '(i have the content in the 'text')
            charCode = AscW(charArray(i))
            If charCode > 127 Then
                sb.Append(String.Format("&#{0};", charCode))
            Else
                sb.Append(Chr(charCode))
            End If
        Next
        Return sb.ToString
    End Function

any help would be appreciated.

-M
0
Comment
Question by:Meenalu
2 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 36540853
Assuming you are working in a Web application. Use HTMLEncode and HTMLDecode method instead of writing your own.

Please do refer http://www.dotnetperls.com/httputility

If you want to perform encode/decode in Javascript side you can go for escape and unescape methods.

0
 

Author Comment

by:Meenalu
ID: 36566908
I have tried with the utility.

when i encode the characters are converted into boxes in the xml file.
and not &12393, and so on.

can i get help with the method i have written in vb.net, please?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQl help with selection 14 44
Problem to picture file 3 40
Get String split 5 33
c# if statement weird reaction 3 29
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now