Reputation: 5038
To print special characters to FPDF I can use either:
$this->Cell($w2, 15, iconv('UTF-8', 'windows-1252', $text));
or
$this->Cell($w2, 15, utf8_decode($text));
but neither of those work with strtoupper
. Example:
$this->Cell($w2, 15, strtoupper(iconv('UTF-8', 'windows-1252', $text)));
$this->Cell($w2, 15, strtoupper(utf8_decode($text)));
$this->Cell($w2, 15, iconv('UTF-8', 'windows-1252', strtoupper($text)));
$this->Cell($w2, 15, utf8_decode(strtoupper($text)));
Given:
$text = "Conformità";
all of these return:
CONFORMITà
instead of:
CONFORMITÀ
The solutions proposed here or in other answers don't work:
mb_strtoupper($text);
mb_strtoupper($text, 'UTF-8');
CONFORMITÀ
Upvotes: 1
Views: 544
Reputation: 11
Try the following (it worked for me):
mb_convert_case($your_string, MB_CASE_UPPER, 'ISO-8859-1');
Upvotes: 0
Reputation: 2438
You need to use the multi-bytes version of the function, mb_strtoupper()
echo strtoupper($text); //CONFORMITà
echo mb_strtoupper($text); //CONFORMITÀ
See PHP documentation : PHP mb_strtoupper()
Upvotes: 0