Search code examples
c#wkhtmltopdfpdf-conversionnreco

Conversion is not happening in Nreco for Chinese currency


I am using NRECo to convert HTML string to Bytes for pdf conversion. Everything works fine but in a string, When I insert Chinese currency symbol (¥) but after conversion, I am seeing Â¥. How do I need to solve this issue?

CNY(¥) Cost 

converts to

CNY(Â¥) Cost

Below code which I am using for conversion.

var converter = new NReco.PdfGenerator.HtmlToPdfConverter();
   var pdfBytes = converter.GeneratePdf(html);
   return pdfBytes; 

Solution

  • Ensure that you've specified UTF-8 encoding in your HTML template with meta-tag:

    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    </head>