I'm trying to write the dagger '†' symbol to a HTML page which gets converted to a PDF document, but this appears on the PDF as 'â€'
I understand that I need to use the HTML code for this symbol, which is †
.
I've done this successfully for the '€' but in these cases I've written the code directly into the HTML. In this case, I'm reading the symbol from an XML file. When I inspect the value of the variable that contains the symbol, it appears as '†'.
I should note that I've tried reading the symbol & the code from the XML file, as follows:
<fund id="777" countryid="N0" append="†" />
and
<fund id="777" countryid="N0" append="†" />
but both are stored in the variable as the symbol, and when I write them to the page, both are rendered as 'â€'. Also, I've 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 works. It appears in the document as:
FundName† †† â€
Can somebody suggest how I can get this to work?
Update:
@James Curran's answer below was correct. Just for the sake of clarity, I had to change the XML to:
<fund id="777" countryid="N0" append="&dagger;" />
and in my C#:
tc.Text = fund.Name + append;