I am trying to write the dagger symbol '†' to an HTML page that is being converted to a PDF document, but it displays in PDF as "
I understand that I need to use HTML code for this character, which † .
I did this successfully for "€", but in these cases I wrote the code directly in HTML. In this case, I am reading a character from an XML file. When I check the value of a variable containing a symbol, it displays as '†'.
I should notice that I tried reading the character and code from the XML file as follows:
<fund id="777" countryid="N0" append="†" />
and
<fund id="777" countryid="N0" append="†" />
but both of them are saved in the variable as a symbol, and when I write them to the page, both are displayed as "â". In addition, I have tried the following:
string code = "†"; string symbol = "†"; string htmlEncodedCode = HttpUtility.HtmlEncode(code); string htmlEncodedSymbol = HttpUtility.HtmlEncode(symbol); tc.Text = fund.Name + code + " " + symbol + " " + htmlEncodedCode + " " + htmlEncodedSymbol;
but only the first work. It appears in the document as:
FundName† †&
Can anyone suggest how I can make this work?
Update:
@James Curran answer below was correct. For clarity, I had to change the XML to:
<fund id="777" countryid="N0" append="&dagger;" />
and in my C #:
tc.Text = fund.Name + append;