From cba5a178c59b9fc72b30cbb5c09ebf494faa6ba9 Mon Sep 17 00:00:00 2001 From: codemasher Date: Sun, 25 Oct 2020 02:53:33 +0200 Subject: [PATCH] :octocat: nah, stop tampering with mb_internal_encoding as it doesn't have an effect here anyway. --- src/QRCode.php | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/QRCode.php b/src/QRCode.php index 9bd2f94fa..91f7aa0eb 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -20,7 +20,7 @@ use chillerlan\QRCode\Output\{ }; use chillerlan\Settings\SettingsContainerInterface; -use function array_search, call_user_func_array, class_exists, in_array, mb_internal_encoding, min, ord, strlen; +use function array_search, call_user_func_array, class_exists, in_array, min, ord, strlen; /** * Turns a text string into a Model 2 QR Code @@ -104,29 +104,13 @@ class QRCode{ */ protected $dataInterface; - /** - * @see http://php.net/manual/function.mb-internal-encoding.php - * @var string - */ - protected $mbCurrentEncoding; - /** * QRCode constructor. * * @param \chillerlan\Settings\SettingsContainerInterface|null $options */ public function __construct(SettingsContainerInterface $options = null){ - // save the current mb encoding (in case it differs from UTF-8) - $this->mbCurrentEncoding = mb_internal_encoding(); - $this->options = $options ?? new QROptions; - } - - /** - * @return void - */ - public function __destruct(){ - // restore the previous mb_internal_encoding, so that we don't mess up the rest of the script - mb_internal_encoding($this->mbCurrentEncoding); + $this->options = $options ?? new QROptions; } /** @@ -138,9 +122,6 @@ 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); }