diff --git a/lib/PHPPdf/Core/Engine/ZF/GraphicsContext.php b/lib/PHPPdf/Core/Engine/ZF/GraphicsContext.php index 5a021bf7..acb63d48 100644 --- a/lib/PHPPdf/Core/Engine/ZF/GraphicsContext.php +++ b/lib/PHPPdf/Core/Engine/ZF/GraphicsContext.php @@ -371,7 +371,7 @@ public function addBookmark($identifier, $name, $top, $parentIdentifier = null) $action = \ZendPdf\Action\GoToAction::create($destination); //convert from input encoding to UTF-16 - $name = iconv($this->encoding, 'UTF-16', $name); + $name = iconv($this->encoding, 'UTF-16BE', $name); $outline = \ZendPdf\Outline\AbstractOutline::create($name, $action); diff --git a/tests/PHPPdf/Test/Core/Engine/ZF/GraphicsContextTest.php b/tests/PHPPdf/Test/Core/Engine/ZF/GraphicsContextTest.php index e1266fa2..6c457fae 100644 --- a/tests/PHPPdf/Test/Core/Engine/ZF/GraphicsContextTest.php +++ b/tests/PHPPdf/Test/Core/Engine/ZF/GraphicsContextTest.php @@ -559,7 +559,7 @@ public function attachSingleBookmark() private function assertOutline($expectedName, $expectedPage, $expectedTop, $actualOutline) { - $this->assertEquals(iconv(self::ENCODING, 'UTF-16', $expectedName), $actualOutline->getTitle()); + $this->assertEquals(iconv(self::ENCODING, 'UTF-16BE', $expectedName), $actualOutline->getTitle()); $target = $actualOutline->getTarget();