diff --git a/module/VuFind/src/VuFind/Theme/Initializer.php b/module/VuFind/src/VuFind/Theme/Initializer.php index 5f218c81754fd4ab1a035d3c028c3c420ee7ac2d..e507391fe1a89998f75fda64938f697db39f9349 100644 --- a/module/VuFind/src/VuFind/Theme/Initializer.php +++ b/module/VuFind/src/VuFind/Theme/Initializer.php @@ -352,6 +352,11 @@ class Initializer $this->resourceContainer->addJs($js); } + // Select encoding: + if ($encoding = $currentThemeInfo->get('encoding')) { + $this->resourceContainer->setEncoding($encoding); + } + // Select favicon: if ($favicon = $currentThemeInfo->get('favicon')) { $this->resourceContainer->setFavicon($favicon); diff --git a/module/VuFind/src/VuFind/Theme/ResourceContainer.php b/module/VuFind/src/VuFind/Theme/ResourceContainer.php index e0daaeac322efa8ec86a9137229e2b99db62221d..466ee7c0c14c18d7c2844a83991af3be743f77ff 100644 --- a/module/VuFind/src/VuFind/Theme/ResourceContainer.php +++ b/module/VuFind/src/VuFind/Theme/ResourceContainer.php @@ -41,6 +41,7 @@ class ResourceContainer protected $css = array(); protected $js = array(); protected $favicon = null; + protected $encoding = 'UTF-8'; /** * Add a CSS file. @@ -98,6 +99,28 @@ class ResourceContainer return array_unique($this->js); } + /** + * Set the encoding. + * + * @param string $e New encoding + * + * @return void + */ + public function setEncoding($e) + { + $this->encoding = $e; + } + + /** + * Get the encoding. + * + * @return void + */ + public function getEncoding() + { + return $this->encoding; + } + /** * Set the favicon. * diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/HeadThemeResources.php b/module/VuFind/src/VuFind/Theme/Root/Helper/HeadThemeResources.php index f112ae822e331b77cd204a524c10d965f0fb2937..dfdc9972de4049b6e8e7d8b1891c0085fa466a98 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/HeadThemeResources.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/HeadThemeResources.php @@ -49,6 +49,12 @@ class HeadThemeResources extends AbstractHelper { $resourceContainer = ThemeTools::getResourceContainer(); + // Set up encoding: + $headMeta = $this->getView()->plugin('headmeta'); + $headMeta()->appendHttpEquiv( + 'Content-Type', 'text/html; charset=' . $resourceContainer->getEncoding() + ); + // Load CSS: $headLink = $this->getView()->plugin('headlink'); foreach ($resourceContainer->getCss() as $current) {