From: x2003bruneau Date: Mon, 16 Apr 2007 21:02:29 +0000 (+0000) Subject: FPDF do not support UTF-8 => utf8_decode all data X-Git-Tag: xorg/0.9.14~81 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ac73e29443d4a8d8558fdf82a92f9b4c2fa4adeb;p=platal.git FPDF do not support UTF-8 => utf8_decode all data git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1709 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/carnet.php b/modules/carnet.php index 1363f5c..24bdaaa 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -261,6 +261,11 @@ class CarnetModule extends PLModule while (list($alias) = $citer->next()) { $user = get_user_details($alias); + foreach ($user as &$value) { + if (is_utf8($value)) { + $value = utf8_decode($value); + } + } $pdf = ContactsPDF::addContact($pdf, $user, $arg0 == 'photos' || $arg1 == 'photos'); } $pdf->Output(); diff --git a/modules/carnet/contacts.pdf.inc.php b/modules/carnet/contacts.pdf.inc.php index 65c1116..bfeb1ae 100644 --- a/modules/carnet/contacts.pdf.inc.php +++ b/modules/carnet/contacts.pdf.inc.php @@ -90,8 +90,8 @@ class ContactsPDF extends FPDF $this->SetFont('Vera Sans', 'B', 20); $this->SetTextColor(230); $this->Rotate(45, 55, 190); - $this->Text(55, 190, "informations limitées à un usage"); - $this->Text(40, 210, "strictement personnel et non commercial"); + $this->Text(55, 190, utf8_decode("informations limitées à un usage")); + $this->Text(40, 210, utf8_decode("strictement personnel et non commercial")); $this->Rotate(0); $this->setLeftMargin(5); @@ -317,6 +317,11 @@ class ContactsPDF extends FPDF foreach ($x['adr'] as $a) { $self->Space(); + foreach ($a as &$value) { + if (is_utf8($value)) { + $value = utf8_decode($value); + } + } $self->Address($a); } @@ -327,6 +332,11 @@ class ContactsPDF extends FPDF { continue; } + foreach ($a as &$value) { + if (is_utf8($value)) { + $value = utf8_decode($value); + } + } $self->Space(); $self->AddressPro($a); }