Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Decoding the encoded characters

Posted on 2011-09-14
2
Medium Priority
?
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 2000 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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