Skip to content

Commit 88267a4

Browse files
committed
#10563: Modified Bundle.js because of breaking Encoding in Production Mode.
1 parent d621424 commit 88267a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/Deploy/Package/Bundle/RequireJs.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,12 @@ private function endBundleFile(WriteInterface $bundleFile, array $contents)
240240
private function getFileContent($sourcePath)
241241
{
242242
if (!isset($this->fileContent[$sourcePath])) {
243-
$this->fileContent[$sourcePath] = utf8_encode(
244-
$this->staticDir->readFile($this->minification->addMinifiedSign($sourcePath))
245-
);
243+
$content = $this->staticDir->readFile($this->minification->addMinifiedSign($sourcePath));
244+
if (mb_detect_encoding($content) !== "UTF-8") {
245+
$content = mb_convert_encoding($content, "UTF-8");
246+
}
247+
248+
$this->fileContent[$sourcePath] = $content;
246249
}
247250
return $this->fileContent[$sourcePath];
248251
}

0 commit comments

Comments
 (0)