Wednesday, May 27, 2009

Display unicode characters in the web control

First let me explain the scenario.

You have unicode data in one of the fields of my DB table, and you want to fetch the unicode data and display it in a textbox lets say a currency symbol £ (GPB).

Now if you are simply assigning the text from datatable field then it would not show £ sign rather some other code value.

Its very simple to display it in its actual form just use

HttpUtility.HtmlDecode on the string
coming from the DB and get the correct output.

Cheers

No comments: