mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-03 22:18:39 +00:00
:octocat: change mb_internal_encoding() on execution, not invocation
This commit is contained in:
+4
-4
@@ -118,10 +118,7 @@ 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;
|
||||
$this->options = $options ?? new QROptions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,6 +138,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user