Skip to content

Commit cba5a17

Browse files
committed
:octocat: nah, stop tampering with mb_internal_encoding as it doesn't have an effect here anyway.
1 parent 952323c commit cba5a17

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/QRCode.php

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
};
2121
use chillerlan\Settings\SettingsContainerInterface;
2222

23-
use function array_search, call_user_func_array, class_exists, in_array, mb_internal_encoding, min, ord, strlen;
23+
use function array_search, call_user_func_array, class_exists, in_array, min, ord, strlen;
2424

2525
/**
2626
* Turns a text string into a Model 2 QR Code
@@ -104,29 +104,13 @@ class QRCode{
104104
*/
105105
protected $dataInterface;
106106

107-
/**
108-
* @see http://php.net/manual/function.mb-internal-encoding.php
109-
* @var string
110-
*/
111-
protected $mbCurrentEncoding;
112-
113107
/**
114108
* QRCode constructor.
115109
*
116110
* @param \chillerlan\Settings\SettingsContainerInterface|null $options
117111
*/
118112
public function __construct(SettingsContainerInterface $options = null){
119-
// save the current mb encoding (in case it differs from UTF-8)
120-
$this->mbCurrentEncoding = mb_internal_encoding();
121-
$this->options = $options ?? new QROptions;
122-
}
123-
124-
/**
125-
* @return void
126-
*/
127-
public function __destruct(){
128-
// restore the previous mb_internal_encoding, so that we don't mess up the rest of the script
129-
mb_internal_encoding($this->mbCurrentEncoding);
113+
$this->options = $options ?? new QROptions;
130114
}
131115

132116
/**
@@ -138,9 +122,6 @@ public function __destruct(){
138122
* @return mixed
139123
*/
140124
public function render(string $data, string $file = null){
141-
// use UTF-8 from here on
142-
mb_internal_encoding('UTF-8');
143-
144125
return $this->initOutputInterface($data)->dump($file);
145126
}
146127

0 commit comments

Comments
 (0)