20
20
};
21
21
use chillerlan \Settings \SettingsContainerInterface ;
22
22
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 ;
24
24
25
25
/**
26
26
* Turns a text string into a Model 2 QR Code
@@ -104,29 +104,13 @@ class QRCode{
104
104
*/
105
105
protected $ dataInterface ;
106
106
107
- /**
108
- * @see http://php.net/manual/function.mb-internal-encoding.php
109
- * @var string
110
- */
111
- protected $ mbCurrentEncoding ;
112
-
113
107
/**
114
108
* QRCode constructor.
115
109
*
116
110
* @param \chillerlan\Settings\SettingsContainerInterface|null $options
117
111
*/
118
112
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 ;
130
114
}
131
115
132
116
/**
@@ -138,9 +122,6 @@ public function __destruct(){
138
122
* @return mixed
139
123
*/
140
124
public function render (string $ data , string $ file = null ){
141
- // use UTF-8 from here on
142
- mb_internal_encoding ('UTF-8 ' );
143
-
144
125
return $ this ->initOutputInterface ($ data )->dump ($ file );
145
126
}
146
127
0 commit comments