Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7526587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:52:20+00:00 2026-05-30T03:52:20+00:00

I have a script which loops through a GridView on my web page, and

  • 0

I have a script which loops through a GridView on my web page, and generates a CSV file out of the values.

An issue was reported with this where symbols were being displayed encoded such as:

Lorem & Ipsum
£100

I’ve used Server.HtmlDecode(), and this has fixed the decoded the values, fixing the ampersand, however the pound sign is now displaying a different symbol:

Lorem & Ipsum
£100

Why is this, and how can I fix this so that the  character doesn’t appear?


The code I’m using to prep the initial value for use in CSV is:

Dim Str As String = String.Format("{0}", Server.HtmlDecode(value).Replace(",", "").Replace(Environment.NewLine, " ").Replace(Chr(10), " ").Replace(Chr(13), " "))

This decodes the HTML, replaces any commas and line breaks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:52:22+00:00Added an answer on May 30, 2026 at 3:52 am

    It’s likely that your source string encoding doesn’t match the output encoding. Set the content encoding before you write out the client to avoid a change in encoding that produces the results you’ve observed.

    You can do this by setting Response.ContentEncoding; for example:

    Response.ContentEncoding = System.Text.Encoding.GetEncoding(1252);
    

    Will give you the Windows 1252 code page. You can also use UTF-8 and ISO 8559-1, or, indeed any other encoding you want.

    You can also set this consistently across your application by using the globalization element in your web.config.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php script with an array which loops through months and displays
I have the following script which I am running. It loops through each table
I have a Perl script which nests foreach loops as seen below. It takes
I have a script which hides (display:none) certain divs in the list on page
For an application I'm developing I need a Perl script which loops through a
I have a script, lets call it linkchecker, that loops through about 10.000 URLs,
I have a datatable which loops through a List and has a value column
I have a simple test bash script which looks like that: #!/bin/bash cmd=rsync -rv
I have a script which contacts a few sources and tell them the IP-address
I have a script which logs on to a remote server and tries to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.