I have a script that goes through a GridView on my webpage and generates a CSV file from the values.
An error was reported when characters were displayed in encoding, for example:
Lorem & Ipsum &
I used Server.HtmlDecode() and this fixed the decoded values, correcting the ampersand, however the pound sign now displays a different character:
Lorem & Ipsum £100
Why is this and how can I fix it so that the  symbol does not appear?
The code that I use to prepare 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 HTML, replaces any commas and line breaks.
source share