Skip to content

Commit 952323c

Browse files
committed
:octocat: change mb_internal_encoding() on execution, not invocation
1 parent c8fcb2d commit 952323c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/QRCode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ class QRCode{
118118
public function __construct(SettingsContainerInterface $options = null){
119119
// save the current mb encoding (in case it differs from UTF-8)
120120
$this->mbCurrentEncoding = mb_internal_encoding();
121-
// use UTF-8 from here on
122-
mb_internal_encoding('UTF-8');
123-
124-
$this->options = $options ?? new QROptions;
121+
$this->options = $options ?? new QROptions;
125122
}
126123

127124
/**
@@ -141,6 +138,9 @@ public function __destruct(){
141138
* @return mixed
142139
*/
143140
public function render(string $data, string $file = null){
141+
// use UTF-8 from here on
142+
mb_internal_encoding('UTF-8');
143+
144144
return $this->initOutputInterface($data)->dump($file);
145145
}
146146

0 commit comments

Comments
 (0)