...

View Full Version : "ã©" instead of "é" When preparing reports in PDF using PHP MySQL and PDF



danilo
06-24-2010, 10:03 PM
I have a web application that uses Mysql database and has been developed in PHP. When displaying the text from the database in HTML format, the french accents are ok, but now I need to develop the reports in PDF and when displaying the texts in PDF, the accents show different characters. The following is the HTML output: "été crédités"
and this is in PDF: "été crédités".

I am receiving the text to display in a $_SESSION variable

This is the code that I am using to create the PDF:

[CODE]

<?php
include "rinclude/Session.php"; // sesion time control
require('../fpdf/fpdf.php');

$pdf=new FPDF('P','mm','Letter');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',11);
$pdf->MultiCell(0,5,$_SESSION[Wsptext]);

$pdf->Output();
?>

[CODE]
I think that is because the character set, but I do not know how to add the character set to the PDF.

Thank you for your help.

warodri
09-22-2010, 07:55 PM
Hi!

I guess you could figure out that problem. I had the same and I could make it work using: html_entity_decode from PHP.

check here: http://www.php.net/manual/en/function.html-entity-decode.php



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum