VBScript Remove HTML and non UTF-8 Characters

Posted on 2012-08-14
Last Modified: 2012-08-29

I have a site that accepts data from a number of different inputs, currently this data is output as an XML feed. However I'm running into issues, as the data can contain both HTML - <p style="astyle"> and non UTF-8 Characters. One of the resources that read the XML have asked us to ensure that all HTML is removed and that the remining text is correctly UTF-8 encoded.

I'm using ASP VBScript to generate the XML, is there a VBscript function that i can use to make sure that the data is as requested?

Many thanks
Question by:garethtnash
    LVL 14

    Assisted Solution

    For removing html tags, you can try this:

    In VB, I would use this:

    Regex.Replace(htmlText, "<.*?>", string.Empty);

    Open in new window

    For setting the encoding, see this:
    LVL 31

    Accepted Solution

    You could also look at, using CDATA, to tell XML parser to ignore.

    Author Closing Comment

    Thanks Both, sorry for the late response.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

    728 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

    17 Experts available now in Live!

    Get 1:1 Help Now