0

I was able to print special character like ™

But when I have to print Φ, I got error "iconv(): Detected an illegal character in input string"

Here's what I've tried so far:

$line = iconv('UTF-8', 'CP1250//TRANSLIT', $line);

  • Does this answer your question? [Special Characters in FPDF with PHP](https://stackoverflow.com/questions/3514076/special-characters-in-fpdf-with-php) – Ken Lee Jul 21 '21 at 03:25
  • @KenLee I've tried all of those but it does not work with some special character like Φ – Beaver Knight Jul 21 '21 at 03:26
  • Greek letters are available in the Symbol font, as can be seen [here](http://www.fpdf.org/en/script/fontdump.pdf). Uppercase phi is `chr(70)`. – Olivier Jul 21 '21 at 07:48

1 Answers1

0

This is working fine. It's a notice, not an error. Here's the Euro example from PHP documentation.

<?php
    $text = "This is the Euro symbol '€'.";

    echo 'Original : ', $text, PHP_EOL;
    echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL;
    echo 'IGNORE   : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL;
    echo 'Plain    : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;
?>

which is going to output:

Original : This is the Euro symbol '€'.
TRANSLIT : This is the Euro symbol 'EUR'.
IGNORE   : This is the Euro symbol ''.
Plain    :

Notice:  iconv(): Detected an illegal character in input string on line 7

There are more hints on how to handle different scenarios in the comment section of the link.

Manny
  • 679
  • 5
  • 12