Ruthra
Ruthra

Reputation: 11

How do I convert data from UTF-8 to ISO-8859-1 without any Broken characters

I have tried to export html data to database with UTF-8 encoding.But I am seeing some "Broken characters" in the database.For example:

while exporting the html data

· A contribution .....

· Choice between two .............

into the database with UTF-8.The (.)midpoint in the data is converted in to (Â.).I need to convert the data explicitly to ISO-8859-1 by removing the broken character in c#. Is there any way to do that ? Thanks in Advance

Upvotes: 1

Views: 415

Answers (1)

Matthew Watson
Matthew Watson

Reputation: 109822

There is a way to specify methods to be invoked in order to handle bad characters when encoding and decoding. You can substitute other characters, or throw an exception, or provide logging etc.

See this overload of GetEncoding() for details.

Upvotes: 1

Related Questions