jump to navigation

Fixing Funny Characters When Exporting Data to Excel September 30 2005

There are two quirks that I came across when exporting data to excel from a data source.

1. Registration marks such as ® came with additional characters attached to them.

Fix: Change the encoding of the response to UTF-7

Response.ContentEncoding = System.Text.Encoding.UTF7

2. Data that had less-than symbols “<” could not permit any of the data after the symbol to be rendered

Fix: Replace data going in with the HTML equivalent

strMyData = strMyData.replace(”<”, “&lt;”)

Comments

Sorry comments are closed for this entry