From d85c5ddb5d2bbbe16c1c85ebad2334e7b52fd322 Mon Sep 17 00:00:00 2001 From: codemasher Date: Sat, 24 Oct 2020 22:58:03 +0200 Subject: [PATCH] :octocat: change mb_internal_encoding() on execution, not invocation --- src/QRCode.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/QRCode.php b/src/QRCode.php index c36567732..5dd47f0b2 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -177,8 +177,6 @@ class QRCode{ public function __construct(SettingsContainerInterface $options = null){ // save the current mb-encoding (in case it differs from UTF-8) $this->mbCurrentEncoding = mb_internal_encoding(); - // use UTF-8 from here on - mb_internal_encoding('UTF-8'); $this->options = $options ?? new QROptions; } @@ -198,6 +196,9 @@ class QRCode{ * @return mixed */ public function render(string $data, string $file = null){ + // use UTF-8 from here on + mb_internal_encoding('UTF-8'); + return $this->initOutputInterface($data)->dump($file); }