What I need
Special characters to work on FPDF, either working with hardcoded strings or results from a DB query
What I’m using
As suggested in some questions here at SO, I’m using tFPDF to get special-characters to work.
Problem
It works on the strings that are retrieved from an MySQL database but not on my hardcoded strings.
Inputs Example
DB string:
Hardcoded equivalent:Operação
Outputs Example

As you can see, the filled cell is the hardcoded one, and the non-filled is the result from the DB.
Code
For hardcode output of table header cell, i’m using the following code:
$pdf->Cell($wO,$h,'Operação',1,0,'C',true);
To output the DB result, I’m using a similar code:
$pdf->Cell($wO,$h,$oper,1,0,'C',$fill);
I already tried utf8_encode but it only gives me rectangles instead of the characters…
I solved this by using Arial font on the table headers and print the cell like this so that it assumes the special character:
Then, I put the special font named DejaVu again so that it places the special characters on the DB results.
Hope it helps anyone with the same problem, I followed this example and got the char number…