$pound_sign = '£'; ..... $pdf->ezText($pound_sign.$somevalue);
On most of the pages, this appeared properly as a pound sign followed by value but in some pages, it wasnt. After lot of debugging and googling around, the problem seems to be one of encoding. If there is a pound sign and its interpreted as a UTF-8 character, it is represented by a 2-byte sequence
0xC2 0xA3
0xC2 is the accented A character and 0xA3 is the one for the pound sign, but if its interpreted as a ISO-8859-1 (Latin) encoding, it is represented as
0xA3
which is what we want.
So, to solve the problem, something like
$pound_sign = html_entity_decode("£", ENT_COMPAT, 'ISO-8859-1');
worked and the accented A disappeared. This is because Im forcing the encoding to be ISO-8859-1 and the character passed to it in 0xA3.
Hope this helps someone
Thanks for this, it's been driving me crazy!
ReplyDeletethank you, great job on this problem!
ReplyDeleteim having also problem with € (EURO) symbol,
was trying to solve it like you did:
html_entity_decode("", ENT_COMPAT, 'ISO-8859-1');"
but it just prints it out like "".
could only solve it with replacement strategy (provided on ezpdf manual). any thought on that ?
Great, this was driving me mad...thanks!
ReplyDeleteThis did indeed help someone - me... Thank you :)
ReplyDeleteThanks very much 2 days I spent trying to fix that!!! I knew it was the UTF-8/ ISO issue but couldn't figure out how to force ISO in php code.
ReplyDelete